Skip to content

refactor: remove max-chunks setting, derive limit from protection range - #48

Merged
tastybento merged 2 commits into
developfrom
remove/max-chunks-setting
Aug 23, 2026
Merged

refactor: remove max-chunks setting, derive limit from protection range#48
tastybento merged 2 commits into
developfrom
remove/max-chunks-setting

Conversation

@tastybento

@tastybento tastybento commented Aug 23, 2026

Copy link
Copy Markdown
Member

Summary

  • The max-chunks config setting was redundant — the protection range already prevents claims outside it via maxRingRadius, so the two settings were doing overlapping work and causing confusion (e.g., an admin setting range to 240 but max-chunks to 441 would silently cap at 441 even though 841 chunks fit).
  • The effective chunk cap is now derived solely from the island's protection range: maxChunks = (2 * floor((range - 8) / 16) + 1)². With range 168 that gives 441 (21x21), exactly what the old default was.
  • Admins adjust the protection range to control island size — one knob instead of two.

Changes

  • Settings.java: removed maxChunks field, config annotations, getter and setter
  • ChunkManager.java: getMaxChunks(island) now returns the range-derived cap directly; checkGeometry no longer checks the removed config setting
  • LevelListener.java: removed max-reached celebration message (no artificial cap to hit)
  • config.yml: removed max-chunks entry, updated protection-range comments
  • ChunkManagerTest: removed testClaimBeyondMaxChunksDenied, updated testMaxChunksDerivedFromProtectionRange
  • Locale max-reached keys left in place across 17 locale files (harmless dead text, not worth the churn)

Test plan

  • 742 tests pass (one removed test for the deleted feature)
  • ChunkBlockTest.testOnLoad passes (Settings field validation)
  • On test server: verify claim is denied at the protection range boundary with the correct "beyond your island's protection area" message

🤖 Generated with Claude Code

https://claude.ai/code/session_01QWvvUY9ZZJHxUYm1UyjdwK

tastybento and others added 2 commits August 23, 2026 08:18
The max-chunks config setting was redundant — the protection range
already prevents claims outside it via maxRingRadius. The effective
chunk cap is now derived solely from the island's protection range:
  maxChunks = (2 * floor((range - 8) / 16) + 1)^2

With the default range of 168 that gives 441 chunks (21x21), exactly
what max-chunks was set to. Admins who want more or fewer chunks
adjust the protection range instead of juggling two settings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QWvvUY9ZZJHxUYm1UyjdwK
@tastybento
tastybento merged commit 3ef7d2e into develop Aug 23, 2026
1 check passed
@tastybento
tastybento deleted the remove/max-chunks-setting branch August 23, 2026 19:55
@sonarqubecloud

Copy link
Copy Markdown

@tastybento tastybento mentioned this pull request Aug 23, 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