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
Resolve conflicts between PR 3 variable shadowing fixes and PRs 1/2/4 already merged into develop (eq() removal, commented code deletion, @OverRide additions, parameterized tests). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ssertions Fix SonarCloud: Variable shadowing in tests and assertion improvements
Resolve conflict in AdminPurgeRegionsCommand.java: keep Files.deleteIfExists() (S4042 fix) over old File.delete() pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix SonarCloud: Production code quality improvements
Fix SonarCloud: Sealed classes, deprecated API, ChatColor removal
…ated Fix SonarCloud: Replace deprecated EntityDamageByEntityEvent and LingeringPotion in tests
Cast int operands to double before addition in Location constructor to prevent potential integer overflow when computing island start coordinates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 tests covering constructor, setup, canExecute, execute (invalid args, null grid, no region files, old/recent .mca files, island protection flags, confirm/delete flow, and player data cleanup). Also documents an inverted login-cutoff check in canDeleteIsland() via a dedicated bug test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 tests covering setup metadata, canExecute (arg-count guards, player resolution, island checks, dimension routing, and named home/island handling), execute (2-arg vs 3-arg failure messages), and tabComplete (all branch paths). Also documents a source bug where the unknown-target error message incorrectly displays the teleportee's name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35 tests covering constructor, blueprint/bundle CRUD, validation, permission checks, file I/O (load/save/delete/rename), and paste error paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…verage - Implement 4 previously @disabled stub tests: onPlayerFeedParrots (tamed/untamed), onSplashPotionSplash, onLingeringPotionSplash - Add tests for onFireworkDamage and onPlayerShootEvent - Fix isPassiveEntity null-type fallback by stubbing monster.getType() to EntityType.ZOMBIE - Total: 39 tests, all passing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Addon.java: replace replaceAll() with replace() for literal string substitution (S5361); remove now-unused Matcher import - AdminTeleportUserCommand: simplify first guard to args.size() < 2 to drop the || operator and reduce cognitive complexity to 15 (S3776) - AdminPurgeRegionsCommand: refactor deletePlayerFromWorldFolder, deleteRegionFiles, and findOldRegions by extracting private helper methods (maybeDeletePlayerData, resolveLastLogin, deletePlayerFiles, deletePlayerFile, isFileFresh, isAnyDimensionFresh, deleteOneRegion, logRegionFolderPaths, collectCandidateNames, addFileNames, parseRegionCoords) to reduce cognitive complexity to within limits (S3776) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract two focused helper classes to satisfy SRP and bring BentoBox's efferent coupling within the Sonar-authorised limit of 20 packages: - BentoBoxListenerRegistrar: owns all event-listener registration and the IslandDeletionManager lifecycle, removing the listeners.teleports package and the PluginManager import from BentoBox. - BentoBoxHookRegistrar: owns all hook instantiation (early, world, and late phases) plus the hasClass() Multiverse detection, removing the hooks.placeholders package from BentoBox. - CommandsManager.registerDefaultCommands(): moves `new BentoBoxCommand()` out of BentoBox, removing the commands package import. No behavioural changes; full test suite passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ng-cherny fix: reduce BentoBox monster-class coupling from 24 to 20 (S1200)
AdminPurgeRegionsCommand: - Remove unused OfflinePlayer import - Introduce DimFolders record to reduce deleteOneRegion from 10 to 4 parameters (S107 - too many parameters) - Replace & with && and extract operands to variables for the overworld deletion chain (S2178 - non-short-circuit operators on booleans) BlueprintsManagerTest: - Remove public modifier from class declaration and all @test methods (S5786 - JUnit 5 test classes/methods need not be public) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…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
|



No description provided.