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.
| public CompletableFuture<Void> homeTeleportAsync(Island island, User user, boolean newIsland) { | ||
| Location loc = island.getHome(""); | ||
| user.sendMessage("commands.island.go.teleport"); | ||
| goingHome.add(user.getUniqueId()); | ||
| readyPlayer(user.getPlayer()); | ||
| return Util.teleportAsync(Objects.requireNonNull(user.getPlayer()), loc).thenAccept(b -> { | ||
| // Only run the commands if the player is successfully teleported |
There was a problem hiding this comment.
homeTeleportAsync(Island, User, boolean) calls island.getHome("") directly and passes the result to Util.teleportAsync(...) without any null check or fallback. For islands that do not yet have a default home (e.g., no-paste creations or legacy islands without homes), island.getHome("") can be null, which will lead to a null Location being used for teleportation and likely a runtime exception. To keep behavior consistent with the existing world-based homeTeleportAsync overload, this method should resolve a safe home location (e.g., via getHomeLocation(island) or equivalent safe-location logic) and handle the case where no home exists before attempting teleport.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| public CompletableFuture<Void> homeTeleportAsync(Island island, User user) { | ||
| return homeTeleportAsync(island, user, false); | ||
| } | ||
|
|
||
| /** | ||
| * Teleport the user home | ||
| * @param island island | ||
| * @param user user | ||
| * @param newIsland true if this is a new island first time teleport | ||
| * @return future when it is done | ||
| */ | ||
| public CompletableFuture<Void> homeTeleportAsync(Island island, User user, boolean newIsland) { | ||
| Location loc = island.getHome(""); | ||
| user.sendMessage("commands.island.go.teleport"); | ||
| goingHome.add(user.getUniqueId()); | ||
| readyPlayer(user.getPlayer()); | ||
| return Util.teleportAsync(Objects.requireNonNull(user.getPlayer()), loc).thenAccept(b -> { | ||
| // Only run the commands if the player is successfully teleported | ||
| if (Boolean.TRUE.equals(b)) { | ||
| teleported(island.getWorld(), user, "", newIsland, island); | ||
| this.setPrimaryIsland(user.getUniqueId(), island); | ||
| } else { | ||
| // Remove from mid-teleport set | ||
| goingHome.remove(user.getUniqueId()); | ||
| } | ||
| }); |
There was a problem hiding this comment.
The new overload homeTeleportAsync(Island, User, boolean) in IslandsManager is not covered by existing tests, whereas other teleport-related behaviors (e.g., the world-based homeTeleportAsync overloads and listeners using them) do have tests. Consider adding unit tests for this method, particularly for cases where the island has and does not have a default home, to ensure it behaves correctly and stays aligned with the existing safe-teleport logic.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@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
… flag (#2797) Replaces the simple on/off world setting with a per-island rank-based protection flag. Island owners can now configure the minimum rank required to trigger a raid (defaults to member rank), giving granular control over who can trigger raids on their island. - Remove VisitorsStartingRaidListener and VISITOR_TRIGGER_RAID flag - Add RaidTriggerListener and RAID_TRIGGER protection flag (ADVANCED mode, default rank: MEMBER_RANK) - Update all 23 locale files with new RAID_TRIGGER key and translations - Add RaidTriggerListenerTest Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
…2796) When the server nether (or end) is disabled via paper-global.yml, Paper does not fire PlayerPortalEvent, so BentoBox's EntityPortalEnterEvent handler manually created one and passed it directly to portalProcess(). This bypassed the Bukkit event bus entirely, meaning PortalListener (which checks the NETHER_PORTAL / END_PORTAL protection flags) never ran and /bsb why returned nothing. Fix: post the manually-constructed PlayerPortalEvent through Bukkit.getPluginManager().callEvent() instead. This lets PortalListener (LOW priority) inspect and potentially cancel the event before PlayerTeleportListener.onPlayerPortalEvent (HIGH priority) processes the teleport, restoring correct flag behaviour for both nether and end portals when the server dimension is disabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add unit tests for homeTeleportAsync(Island, User, boolean) overload
…ion_flag Convert VISITOR_TRIGGER_RAID world setting to RAID_TRIGGER protection flag
…ause-handling Use TeleportCause.PLUGIN instead of TeleportCause.UNKNOWN for plugin-initiated teleports
- `/bbox placeholders` (alias `ph`) opens a hierarchical GUI showing all registered placeholders grouped by source (BentoBox core + each addon). The panel layout is customisable via `BentoBox/panels/placeholder_panel.yml` and `placeholder_list_panel.yml`. - `/bbox dump-placeholders` writes `plugins/BentoBox/placeholder-dump.md`, a Markdown table of every placeholder and its plain-English description, suitable for the BentoBoxWorld/docs site. Data-layer changes: - `BasicPlaceholderExpansion` stores a description alongside each replacer and tracks a disabled-placeholder set for in-memory toggle. - `PlaceholderHook` / `PlaceholderAPIHook` gain description-aware overloads, enable/disable API, and introspection methods (getRegisteredPlaceholders, getAddonsWithPlaceholders, getDescription). - `PlaceholdersManager` exposes the same API publicly and fixes a bug where only the first placeholder per addon was tracked. - `GameModePlaceholder` constants now carry a plain-English description string. Scalability improvements for large placeholder sets: - `PlaceholderGrouper` collapses numeric-suffix series (e.g. island_member_name_1..50) into a single Series item, reducing thousands of rows to a handful. - `PlaceholderNode` builds a `_`-split trie with path compression (single-child FOLDER chains are merged) for efficient tree navigation. - `PlaceholderListPanel` uses the trie for drill-down navigation with five node types (LEAF/FOLDER/LEAF_FOLDER/SERIES/LEAF_SERIES), each with appropriate icons and left/right-click semantics. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change panel title colour from &6 (gold) to &3 (dark aqua) for readability against the grey inventory background. - Remove the " Placeholders" suffix from the list-panel title and show only the current node label (not the full breadcrumb path), keeping the title within Minecraft's ~22-char bold-text limit. - Wrap long placeholder descriptions at 38 characters per line so text like "Number of members currently online on the island the player is standing on" is split across readable lore lines instead of overflowing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each placeholder item in the list panel now shows the current value for the viewing player alongside the description: - LEAF / LEAF_FOLDER: one "→ <value>" line (or "→ (empty)" if blank) - SERIES / LEAF_SERIES: up to 3 sample lines "#N → <value>" for the first N members of the series, so admins can verify the values without leaving the GUI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ests
- PlaceholderPanel: hide the BentoBox core placeholder button when no
core placeholders are registered (currently always 0), avoiding a
confusing "0 core placeholders" entry in the GUI.
- PlaceholderListPanel: fix LEAF_SERIES button name — series.displayKey()
already contains "_{N}", so appending it again produced "stem_{N}_{N}".
- Add PlaceholderGrouperTest (18 tests) covering: empty input, plain
single keys, numeric-suffix series detection, min/max tracking, raw-key
ordering, stem-also-registered-as-single case, output sorting,
description lookup, series description stripping, and the
stripTrailingHashNumber helper.
- Add PlaceholderNodeTest (19 tests) covering: empty trie, single/series
node construction, all five NodeType values, path compression (stops at
leaf, series, and multi-child nodes; partial compression for fan-out
chains), alphabetic sort of display children, totalPlaceholderCount
(leaf / series / recursive), and drill-into navigation of a compressed
node.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add placeholder browser GUI and dump command (#1332)
…isabled_nether Fix NETHER_PORTAL flag bypass when paper misc.enable-nether is false
Refactor AdminPurgeRegionsCommand to dynamically handle nether and end world regions
Nether and End worlds store region data in DIM-1/ and DIM1/ subfolders within their world folder, but the purge command was looking directly in worldFolder/region/ which doesn't exist. This caused deleteIfExists() to silently succeed without actually deleting anything. Add resolveDataFolder() helper that checks the world's environment type and resolves the correct dimension subfolder (DIM-1 for nether, DIM1 for end). Also add diagnostic logging to confirm which paths are used and how many region files are found per dimension. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix purge regions not deleting nether/end region files
|


No description provided.