Skip to content

Store the allow-mobs list in BentoBox, not in game mode configs - #3113

Merged
tastybento merged 3 commits into
developfrom
fix/allow-mobs-core-storage
Nov 6, 2026
Merged

tastybento merged 3 commits into
developfrom
fix/allow-mobs-core-storage

Conversation

@tastybento

Copy link
Copy Markdown
Member

Follow-up to #3112, which was merged before the rework below was pushed. As merged, the allow list lives behind a WorldSettings default 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

  • Removes WorldSettings#getMobAllowSettings(). No game mode changes are needed, now or later.
  • New CoreWorldSettings data object, one record per game mode keyed by addon name, saved through the normal database layer. On the flat-file database it is plugins/BentoBox/database/CoreWorldSettings/<GameMode>.json.
  • IslandWorldManager#getMobAllowSettings(World), #getCoreWorldSettings(World) and #saveCoreWorldSettings(World). First use seeds the record from GameModeAddon#getDefaultAllowedMobs(), which defaults to IRON_GOLEM; a game mode may override the seed.
  • GeoMobLimitTab saves the allow list via IWM rather than the game mode's config.
  • Checks objectExists before loading so the first run does not log Could not load file ... File not found from the flat-file handler.
  • Tests for seeding, loading, saving and the non-game-world case; tab test asserts the save path.

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

tastybento and others added 3 commits November 5, 2026 07:42
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>
@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@tastybento
tastybento merged commit 02816a3 into develop Nov 6, 2026
3 checks passed
@tastybento
tastybento deleted the fix/allow-mobs-core-storage branch November 6, 2026 02:31
@tastybento tastybento mentioned this pull request Nov 7, 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