Repository navigation
Store the allow-mobs list in BentoBox, not in game mode configs - #3113
Merged
Merged
Conversation
Game modes only persist what their own Settings class declares, so a WorldSettings default method could never save admin edits and the panel appeared dead on every existing game mode release. Replace it with a BentoBox-stored record per game mode (CoreWorldSettings, table "WorldSettings"), loaded and saved through the normal database layer and seeded from GameModeAddon#getDefaultAllowedMobs() (IRON_GOLEM) on first use. No game mode changes are needed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The flat-file handlers log "Could not load file ... File not found" when loadObject is asked for a missing record, so the first-run seed path produced a spurious error. Ask objectExists first. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…onNull-valued map Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
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.



Follow-up to #3112, which was merged before the rework below was pushed. As merged, the allow list lives behind a
WorldSettingsdefault method that returns a fresh empty list on every call, so the panel appears dead and nothing is seeded on every existing game mode release (verified on AOneBlock 1.28.0). This PR replaces that with BentoBox-owned storage.Change
WorldSettings#getMobAllowSettings(). No game mode changes are needed, now or later.CoreWorldSettingsdata object, one record per game mode keyed by addon name, saved through the normal database layer. On the flat-file database it isplugins/BentoBox/database/CoreWorldSettings/<GameMode>.json.IslandWorldManager#getMobAllowSettings(World),#getCoreWorldSettings(World)and#saveCoreWorldSettings(World). First use seeds the record fromGameModeAddon#getDefaultAllowedMobs(), which defaults toIRON_GOLEM; a game mode may override the seed.GeoMobLimitTabsaves the allow list via IWM rather than the game mode's config.objectExistsbefore loading so the first run does not logCould not load file ... File not foundfrom the flat-file handler.Tested in-game on AOneBlock 1.28.0 / Paper 26.3: Iron Golem is green on first open, toggles persist across restart, no startup error.
Docs: BentoBoxWorld/docs#115.
🤖 Generated with Claude Code