Let islands choose who may claim chunks - #19
Merged
Conversation
Claiming was hard-coded to the island owner, and a teammate who hit the border got nothing back at all — no message, no sound — which reads as a broken mechanic rather than as a permission. Who may spend the island's level credit is now the CHUNKBLOCK_CLAIM_CHUNKS protection flag, so an island can open expansion to sub-owners, members, trusted or coop through the ordinary island settings GUI, and servers can move the default in default-island-flags. The flag defaults to owner rank, so nothing changes until an island says otherwise. A teammate below the rank is now told why instead of being ignored. Visitors and passers-by still get nothing: they see the ordinary locked-chunk message from the guard listener, and another island's credit is none of their business. The guard listener carried the same hard-coded owner check, so a teammate bumping into the border never saw the claim hint even on an island that had opened claiming to them. It now asks the same flag. Both listener tests move from mocking ChunkBlock to spying on a real one: a mock leaves the final flag fields null, and BossBarListenerTest already establishes the spy pattern for exactly this reason. Part of #6. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Taa2snoHkvtcZ6e5rAHDQS
|
Merged
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.



Claiming was hard-coded to the island owner, and a teammate who hit the border got nothing back at all — no message, no sound,
ChunkClaimListenersimply returned. That reads as a broken mechanic rather than as a permission, and it is the concrete complaint behind #6.Who may spend the island's level credit is now the
CHUNKBLOCK_CLAIM_CHUNKSprotection flag. An island can open expansion to sub-owners, members, trusted or coop through the ordinary island settings GUI, and servers can move the default indefault-island-flags. It defaults to owner rank, so nothing changes until an island says otherwise.That covers the first three options Floris asked for — owner only, sub-owner or higher, configurable island rank — using machinery BentoBox already has rather than a bespoke setting.
Feedback
ChunkGuardListener.sendBumpMessagecarried the same hard-coded owner check, so a teammate walking into the border never saw the claim hint even on an island that had opened claiming to them. It now asks the same flag.Tests
627 green. Five new: below-rank denied with feedback, a non-owner member allowed once the island opens it, a visitor told nothing, the bump inviting an allowed player, and the bump only saying "locked" otherwise.
Both listener test classes move from
mock(ChunkBlock.class)tospy(new ChunkBlock())— a mock leaves thefinalflag fields null, andBossBarListenerTestalready establishes the spy pattern for exactly this reason. That is the bulk of the test diff.Deliberately not included
The team proposal and team vote options from #6. They are a workflow engine for a one-click action, and the confirmation step in #17 already solves the underlying "don't waste the island's levels by accident" worry that motivated them. Easy to add later if the rank flag proves too blunt.
So #6 should stay open after this merges, or be closed with a note about the voting options being declined — your call.
Unrelated observation
MAGIC_BLOCKatChunkBlock.java:128uses an unprefixed flag ID that AOneBlock almost certainly also registers. Duplicate flag IDs get rejected byFlagsManager, which is whyCHUNKBLOCK_BOSSBAR/ACTIONBAR/START_SAFETYwere renamed — this one looks like it was missed. Not touched here (renaming resets the flag on live islands), but it likely wants its own issue.🤖 Generated with Claude Code
https://claude.ai/code/session_01Taa2snoHkvtcZ6e5rAHDQS