Repository navigation
Start a new exhaustion period when the cooldown ends - #176
Merged
Merged
Conversation
A cooldown shorter than the exhaustion period did nothing: when it expired the block count was still at the limit, so the generator went straight back on cooldown until the period ended. Now an expired cooldown starts a fresh period with the count reset to 0. A cooldown of 0 keeps its previous meaning (wait until the period ends) by holding the generator until the period end, which also makes the generator-exhausted message show the correct minutes remaining. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The number formatter used owner.getLocale(), but owner is null on spawn islands and islands without an owner. Format with the purchasing user's locale instead: they are the one who receives the messages. Fixes Sonar java:S2259. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Also fixed the Sonar S2259 issue that this PR touched: |
|
tastybento
added a commit
that referenced
this pull request
Nov 17, 2026
Reliability (quality gate): - IslandEditPanel: read the island name before getGeneratorData, whose null check made Sonar treat the island as nullable. - IslandEditPanel: null-safe game mode name in three button descriptions. - canPurchaseGenerator NPE: cherry-picked from #176. Code smells in StoneGeneratorImportManager: constants for repeated literals, rename a local that hid a field, extract export error reporting to cut complexity, make DefaultJSONHandler fields final. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 17, 2026
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.



Summary
An admin asked on Discord how to change the generator exhaustion cooldown. While checking, I found that
exhaustion.cooldownwas ignored whenever it was shorter thanexhaustion.period.Bug: in
StoneGeneratorManager.canGenerateBlock, the block count was reset only when the period ended. When a cooldown shorter than the period expired, the count was still at the limit, so the next attempt put the generator straight back on cooldown. In practice the generator stayed stopped until the cooldown was over and the period had ended, whichever was later. For example, withperiod: 60,cooldown: 10, a generator that hit its limit after 5 minutes stayed stopped for about 55 minutes instead of 10.Fix:
cooldown: 0still means "wait until the period ends": the generator is held until the period end. Thegenerator-exhaustedmessage now also shows the right minutes left in that case. Before, it showed 0.exhaustion.cooldowncomment inconfig.ymlto describe both cases.Behaviour is unchanged for the default settings (
cooldown: 1440≥period: 60).Test plan
cooldown: 0blocks until the period ends, then resumesmvn test: 167 tests, 0 failuresDocs follow-up: BentoBoxWorld/docs#136 describes the current (pre-fix) behaviour. Its "How it works" step 5 should be updated once this is released.
🤖 Generated with Claude Code