feat: donations-only mode — skip block scan (#430)#432
Merged
Conversation
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>
|
3 tasks
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.



Closes #430.
Summary
donations-onlyconfig option inconfig.yml(defaultfalse). Whentrue, the per-recalculation island chunk scan is skipped entirely and the island level is computed only from blocks donated via/island donate.IslandLevelCalculator.scanIslandshort-circuits straight totidyUp()in this mode, which already reads the donated points fromLevelsManager.getDonatedPoints(island)and applies the configuredlevel-calcformula. The death penalty is still applied./island detailis 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 donatecontinue to work;/island levelreports the level based on donated blocks alone.Why this scope
From the issue thread:
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)donations-only: true:/island levelreports a level based only on donated points;/island detailis not registered;/island donate hand/invstill works and updates the leveldonations-only: false(default): all five player commands register and the existing scan-based flow is unchanged🤖 Generated with Claude Code