Skip to content

Configurable structure toggles for overworld cave generation (#112)#113

Merged
tastybento merged 1 commit into
developfrom
feature/configurable-structures
Jul 6, 2026
Merged

Configurable structure toggles for overworld cave generation (#112)#113
tastybento merged 1 commit into
developfrom
feature/configurable-structures

Conversation

@tastybento

Copy link
Copy Markdown
Member

Fixes #112.

The CaveBlock overworld delegates to vanilla generation, which includes structures like Ancient Cities, Trial Chambers and Strongholds. Some of these fill or unbalance a cave world — the issue shows an Ancient City taking over almost an entire cave area. Bukkit's ChunkGenerator structure flag is all-or-nothing, so this adds per-structure control.

What changed

world.structures config (Map<String, Boolean>)

world:
  structures:
    ancient_city: false
    trial_chambers: false
    mansion: false
    mineshaft: true
    stronghold: true
  • Each entry maps a vanilla structure key to whether it may generate.
  • Structures not listed generate as normal, so this is non-invasive.
  • Defaults disable the big disruptive ones (ancient_city, trial_chambers, mansion) and leave common ones on.
  • Only affects the overworld (nether/end don't generate vanilla structures here).

StructureGenerationListener

Cancels AsyncStructureSpawnEvent for any disabled structure in the CaveBlock overworld. The event is async and the handler only reads config + inspects the event (no world access), so it's thread-safe. Key matching tolerates hyphens and casing (e.g. Ancient-City matches ancient_city).

Also

  • config.yml documents the new section with the list of accepted structure keys.
  • pom.xml — bump build.version to 1.23.0.

Notes

  • BentoBox requires both a getter and setter for @ConfigEntry fields; both are provided for the new map.
  • Admins can re-enable any structure by setting it to true or removing its entry.

Tests

Added StructureGenerationListenerTest (disabled cancelled, enabled/unlisted allowed, non-CaveBlock world ignored, nether ignored, hyphen/case matching). All 67 tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KxBgEZz7yHf4eLVzJTw1V5

The overworld delegates to vanilla generation, which can produce structures
such as Ancient Cities, Trial Chambers and Strongholds. Large ones can fill or
unbalance a cave world (issue #112). The ChunkGenerator flag is all-or-nothing,
so this adds per-structure control:

- Settings: new world.structures map (Map<String, Boolean>) of structure key to
  whether it may generate. Structures not listed generate normally. Defaults
  disable ancient_city, trial_chambers and mansion; mineshaft and stronghold
  stay on.
- StructureGenerationListener: cancels AsyncStructureSpawnEvent for any disabled
  structure in the CaveBlock overworld. Key matching tolerates hyphens/case.
- config.yml: documents the new section.
- pom.xml: bump build.version to 1.23.0.

Adds StructureGenerationListenerTest. All 67 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxBgEZz7yHf4eLVzJTw1V5
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@tastybento tastybento merged commit 51b1fcd into develop Jul 6, 2026
3 checks passed
@tastybento tastybento deleted the feature/configurable-structures branch July 6, 2026 20:25
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.

Configurable cave world generation / structure toggles

1 participant