Add opt-in support for team members' limit permissions#282
Merged
Conversation
2 tasks
8b25c01 to
c9aa5c8
Compare
Permission-based limits were applied from the island owner only, which surprises team servers where a member buys a rank with higher limits. New config option apply-member-limit-perms (default false). When enabled, a team member's login merges their limit permissions into the island's limits (highest value wins), and the owner's login still recalculates from scratch and then merges the permissions of all online team members. Coop and trusted players do not qualify. Limits recalculate on login, so revoking a member's permission takes effect at the owner's next login. Fixes #241 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB
c9aa5c8 to
7f6b3b5
Compare
|
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.



Fixes #241 (canonical ticket for #164 and part of #147's fallout).
What
New config option, off by default:
When enabled:
<gamemode>.island.limit.*permissions into the island's limits — the highest value wins, nothing is cleared.Island.getMemberSet()is rank ≥ MEMBER) and never apply.Documented caveat (in config comments): limits recalculate on login, so revoking a member's permission or kicking them takes effect at the owner's next login — consistent with how owner permissions already behave.
How
JoinListener.checkPermsis split into the clearing part and a newmergePerms(apply without clearing — the max-merge already existed inapplyLimit).onPlayerJoinnow also matches islands where the player is a qualifying member. TheLimitsJoinPermCheckEventfires for member joins too, so other plugins can cancel.Tests
Five new JUnit cases: member ignored when disabled; member merged when enabled (and never clears); member perm doesn't lower a higher existing limit; owner join merges online members' perms after recalc; offline members ignored. Full suite: 261 tests green.
In-game test plan
apply-member-limit-perms: true, setblocklimits: HOPPER: 10.bskyblock.island.limit.hopper.50: member logs in →/is limitsshows 50 for both.false(default) → member perms have no effect (current behaviour unchanged).🤖 Generated with Claude Code
https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB