Conversation
There was a problem hiding this comment.
Pull request overview
This PR bumps the plugin to version 3.11.2 and refines island/home teleport and primary-island handling, while updating the build to target newer Paper and Java 21 settings.
Changes:
- Extend
IslandsManager.getIsland(World, UUID)to prefer the island the (online) player is currently on, and introduce a newhomeTeleportAsync(Island, User, boolean)overload plusgetPrimaryIsland(World, UUID)convenience method. - Adjust island creation (
NewIsland) and/is gologic to use the new APIs (including support for island-name destinations) and to better manage spawn/home locations and primary islands. - Update Gradle build configuration for version
3.11.2, newer Paper API, and consistent Java 21 compilation; adapt tests to the updated method overloads.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/world/bentobox/bentobox/api/commands/island/IslandExpelCommandTest.java | Tightens the Mockito verification to the homeTeleportAsync(World, Player) overload after new overloads were added. |
| src/main/java/world/bentobox/bentobox/managers/island/NewIsland.java | After island creation, now sets the island-based home location and primary island, and uses the new homeTeleportAsync(Island, User, boolean) for first-time teleports. |
| src/main/java/world/bentobox/bentobox/managers/IslandsManager.java | Changes getIsland(World, UUID) to check the player’s current island when online, adds getPrimaryIsland(World, UUID) and homeTeleportAsync(Island, User[, boolean]), and wires these into existing home-location logic. |
| src/main/java/world/bentobox/bentobox/database/objects/Island.java | Simplifies setSpawnPoint to avoid unnecessary setChanged() calls and to clone the stored Location. |
| src/main/java/world/bentobox/bentobox/api/commands/island/IslandGoCommand.java | Refactors /is go to distinguish between island names and home names, setting primary islands accordingly and using either the existing world-based teleport or the new island-based teleport. |
| build.gradle.kts | Bumps plugin version to 3.11.2, updates Paper API version, drops the Spigot compile-only dependency, and standardizes Java 21 compiler options for main and test sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@tastybento I've opened a new pull request, #2792, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@tastybento I've opened a new pull request, #2793, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Fix Javadoc @link syntax in getPrimaryIsland method
|
@tastybento I've opened a new pull request, #2794, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Extend the ALLAY flag to also protect Copper Golems in EntityInteractListener. A player right-clicking a Copper Golem that is carrying an item would cause it to drop the item, bypassing island protection. Copper Golems carry items just like Allays, so the ALLAY flag is the logical fit. Entity type is matched by name string for cross-version safety, consistent with Util.isPassiveEntity(). Closes #2798 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on/EntityInteractListenerTest.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…tion_protection Fix Copper Golem item theft via player interaction
…stallman Fix Sonar code quality issues: S5361, S3776 complexity
Extract five private static methods (readTemplateItem, populateContentGrid, readFallback, readActionsFromSection, readActionsFromList) to eliminate duplicated parsing blocks and flatten deeply nested control flow in readPanelTemplate and readPanelItemTemplate. No behaviour changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-complexity Reduce cognitive complexity in TemplateReader
36 tests covering the Builder, checkLocation(), getChunksToScan(), addChunk(), checkPosition(), scanBlockQueue(), scanAndPopulateBlockQueue(), makeAndTeleport(), gatherChunks(), finishTask(), and asyncTeleport(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace 4 @disabled placeholder tests with 25 real JUnit 5 tests covering all state machine transitions, constructor variants, NMS mocking via mockConstruction/mockedUtil, and message verification. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t-teleport Add JUnit5 tests for ClosestSafeSpotTeleport
Covers constructor/schema creation, CRUD operations (loadObjects, loadObject, saveObject, deleteID, deleteObject), objectExists, close, quote-wrapping behaviour, error logging paths, and the async-guard branch in store(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dler Add JUnit 5 tests for SQLDatabaseHandler
23 tests covering constructor behaviour, panel building with various player/search configurations, NEXT/PREVIOUS pagination, BACK button, all three prospect click-handler actions (invite, coop, trust), and the InviteNamePrompt inner class. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement comprehensive BlueprintPasterTest suite
…te-gui Add JUnit 5 tests for IslandTeamInviteGUI
When force-shown is set to an integer N, mark all rows 1 through N as forced rather than only row N. The previous code caused intermediate rows to be skipped in createItemMap (which only advances its slot index for forced rows), so force-shown: 6 produced a 2-row inventory instead of 6. Fixes #2471 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract fetchRaw() in GitHubWebAPI and add fetchArray() to correctly handle JSON array responses (fixes bug in getContributors()) - Add getLatestTagName() to GitHubRepository using the /tags endpoint - Add isNewerVersion(), checkForUpdates(), and printUpdateBanner() to WebManager; wired into requestGitHubData() behind isCheckBentoBoxUpdates() - LOCAL builds skip the check; colored console banner shown when outdated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
HashMap.computeIfAbsent throws ConcurrentModificationException when the mapping function re-enters the same map (e.g. when loading a class triggers loading another class via the same loader). Switch to ConcurrentHashMap which handles re-entrant computeIfAbsent safely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add JUnit5 tests for DefaultPasteUtil
…fications Add automatic update notifications on startup
…n-fix Fix force-shown integer value not showing correct number of rows
…om Answer The default mock Answer now only returns String arguments for String-returning methods, preventing Mockito from throwing WrongTypeOfReturnValue when stubbing boolean methods like hasPermission(String). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bility Commit d244c40 changed getMemberSet() overloads from ImmutableSet<UUID> to Set<UUID> to satisfy SonarCloud S4738. This is a binary-incompatible API change: addons compiled against any prior BentoBox version will throw NoSuchMethodError at runtime because the JVM encodes the return type in the method descriptor. Reverts to ImmutableSet<UUID> with @SuppressWarnings("java:S4738") and a comment explaining the rationale. Also stubs the two newly-typed overloads in CommonTestSetup (Mockito no longer auto-stubs ImmutableSet with an empty set) and adds missing itc command mocks to IslandTeamInviteGUITest so the testBackButtonClick_notInviteCmd_closesInventory test passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ConcurrentHashMap.computeIfAbsent() throws IllegalStateException when a nested call tries to compute another entry while an outer computation is in progress. This happened because super.findClass() triggers loading of dependent classes, which re-enter findClass() and call computeIfAbsent() on the same map. Replace computeIfAbsent with an explicit get → compute → put pattern that does not hold the map's internal lock during class loading, eliminating the recursive update. Guava ImmutableSet and similar classes with cross-addon dependencies were causing DimensionalTrees (and likely other addons) to fail on load. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pat-and-classloader-fix Fix binary-incompatible getMemberSet() return type and AddonClassLoader recursive update
|
@claude Review the PR |
…ding The nested TreeMap implementation had O(n²) complexity during island loading due to full-grid scans in removeFromGrid() and headMap() overlap detection. This caused servers with many islands to hang at "Loading islands from database.." (fixes #2838). Also fixes a correctness bug in getIslandStringAt() where the floorEntry() approach could miss large islands at lower X keys when smaller islands existed at closer X coordinates — critical for arbitrary island positions (Stranger Realms). Replaces internals with a cell-based spatial hash (HashMap<Long, Set<String>>) giving O(1) average-case point lookups, O(c×k) insertion with overlap detection, and O(c) removal. Replaces getGrid() with getAllIslands() and getIslandsInBounds() and updates AdminPurgeRegionsCommand accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace IslandGrid nested TreeMap with spatial hash
…can report
- isNether/isEnd were computed once at constructor time before IWM had
loaded the addon world config, causing the Nether to always appear
disabled. Now evaluated at the start of findIslands() each run.
- canDeleteIsland() had the recent-login branch returning false ("can
delete") instead of true ("cannot delete"), and used findFirst()
instead of anyMatch() so only the first team member was checked.
- Replace the removeIf filter with an explicit iterator loop that
counts islands blocked by level threshold and purge protection, and
reports how many regions each prevents from being purged.
- Add an immediate "please wait" notice right after the candidate count
is logged, before the multi-second freshness/island check begins.
- Update the bug-documenting test to assert the now-correct behaviour:
an island whose member logged in recently is excluded from purge.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…login-check-report Fix purge regions: nether detection, login check inversion, and scan report
|



No description provided.