Skip to content

Let islands choose who may claim chunks - #19

Merged
tastybento merged 1 commit into
developfrom
feat/claim-rank-flag
Aug 8, 2026
Merged

Let islands choose who may claim chunks#19
tastybento merged 1 commit into
developfrom
feat/claim-rank-flag

Conversation

@tastybento

Copy link
Copy Markdown
Member

Stacked on #17. Based on feat/claim-confirmation so the diff shows only the rank work. GitHub will retarget this to develop once #17 merges.

Claiming was hard-coded to the island owner, and a teammate who hit the border got nothing back at all — no message, no sound, ChunkClaimListener simply 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_CHUNKS protection 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 in default-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

  • A teammate below the rank is now told why: "Your rank cannot claim chunks for this island!" with the bass note, throttled through the existing 2s cooldown.
  • Visitors and passers-by still get nothing. They see the ordinary locked-chunk message from the guard listener; another island's credit is none of their business. There is a test pinning this.
  • ChunkGuardListener.sendBumpMessage carried 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) to spy(new ChunkBlock()) — a mock leaves the final flag fields null, and BossBarListenerTest already 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_BLOCK at ChunkBlock.java:128 uses an unprefixed flag ID that AOneBlock almost certainly also registers. Duplicate flag IDs get rejected by FlagsManager, which is why CHUNKBLOCK_BOSSBAR/ACTIONBAR/START_SAFETY were 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

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
@sonarqubecloud

sonarqubecloud Bot commented Aug 8, 2026

Copy link
Copy Markdown

Base automatically changed from feat/claim-confirmation to develop August 8, 2026 19:49
@tastybento
tastybento merged commit cd7e603 into develop Aug 8, 2026
3 checks passed
@tastybento
tastybento deleted the feat/claim-rank-flag branch August 8, 2026 19:49
@tastybento tastybento mentioned this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant