Refuse setowner when recipient is at the concurrent-islands cap#2966
Merged
tastybento merged 1 commit intodevelopfrom May 5, 2026
Merged
Refuse setowner when recipient is at the concurrent-islands cap#2966tastybento merged 1 commit intodevelopfrom
tastybento merged 1 commit intodevelopfrom
Conversation
Both AdminTeamSetownerCommand and IslandTeamSetownerCommand previously allowed ownership transfer to a player who already owned their maximum allowed concurrent islands. AdminTeamSetownerCommand only emitted a warning after the fact; IslandTeamSetownerCommand had no check at all. This was a clean bypass of `concurrent-islands` and the per-player `island.number.<n>` permission cap. Both commands now compute the recipient's current concurrent island count and permission-aware cap in canExecute and refuse the transfer when at or above the limit. The user-facing path uses the existing `commands.island.team.setowner.errors.at-max` locale entry; the admin path gets a parallel `commands.admin.team.setowner.errors.at-max` message that includes the count and limit so the admin can adjust the recipient's permission if they really intend to allow it. Closes #2908.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
concurrent-islandscap, instead of letting the transfer through and merely warning afterwards.commands.admin.team.setowner.errors.at-max) and wires up the existing user-facingcommands.island.team.setowner.errors.at-maxentry that was previously unused.Why
Setting
concurrent-islands: 1(or any per-playerisland.number.<n>permission) only gatedIslandCreateCommand. A player could be added as a member, then have the island handed to them via/is team setowneror/bbox team setowner, ending up with multiple owned islands regardless of the limit.AdminTeamSetownerCommandcarried a post-transfer "warning" that the player now owns more than allowed, but it never actually blocked the action.The fix moves the check into
canExecuteso the cap holds in both flows. An admin who really wants to push a recipient over the limit can raise theirisland.number.<n>permission first; the error message tells them exactly that.Test plan
./gradlew test --tests AdminTeamSetownerCommandTest --tests IslandTeamSetownerCommandTest./gradlew build -x testtestCanExecuteTargetAtConcurrentIslandsCapcases on both commands cover the refusal path.Closes #2908.