Skip to content

feat: donations-only mode — skip block scan (#430)#432

Merged
tastybento merged 1 commit into
developfrom
feat/430-donations-only-mode
May 12, 2026
Merged

feat: donations-only mode — skip block scan (#430)#432
tastybento merged 1 commit into
developfrom
feat/430-donations-only-mode

Conversation

@tastybento
Copy link
Copy Markdown
Member

Closes #430.

Summary

  • New donations-only config option in config.yml (default false). When true, the per-recalculation island chunk scan is skipped entirely and the island level is computed only from blocks donated via /island donate.
  • IslandLevelCalculator.scanIsland short-circuits straight to tidyUp() in this mode, which already reads the donated points from LevelsManager.getDonatedPoints(island) and applies the configured level-calc formula. The death penalty is still applied.
  • /island detail is not registered in this mode (per the issue thread — there are no scanned blocks to break down). /island level, /island top, /island value, and /island donate continue to work; /island level reports the level based on donated blocks alone.

Why this scope

From the issue thread:

The donation menu provides automatic level counting, so the "/ob level" command is not needed […]
I think you still need to see your level though, but it will be based on only the donated blocks. […] I agree that the detail command will not be required.

So the change keeps the rest of the player commands intact and only drops the detail command, which has no useful output when there is no block scan.

Test plan

  • mvn test — 217/217 pass (1 new test for the gated detail command)
  • In-game with donations-only: true: /island level reports a level based only on donated points; /island detail is not registered; /island donate hand/inv still works and updates the level
  • In-game with donations-only: false (default): all five player commands register and the existing scan-based flow is unchanged

🤖 Generated with Claude Code

Adds a `donations-only` config option that bypasses the island chunk scan
entirely. The island level is computed only from blocks donated via
`/island donate`, removing the per-recalculation CPU cost of scanning.

When the option is enabled:
- IslandLevelCalculator.scanIsland short-circuits to tidyUp(), which adds
  the donated points (`LevelsManager.getDonatedPoints`) and runs the
  configured level-calc formula on those points alone.
- The /island detail command is not registered, since there are no
  scanned blocks to break down per the issue thread.
- /island level, /island top, /island value, and /island donate continue
  to work; /island level reports the level based on donations only.

Closes #430.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@tastybento tastybento merged commit c7f7bfb into develop May 12, 2026
3 checks passed
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.

Donate menu

1 participant