Configurable structure toggles for overworld cave generation (#112)#113
Merged
Conversation
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
|
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.



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
ChunkGeneratorstructure flag is all-or-nothing, so this adds per-structure control.What changed
world.structuresconfig (Map<String, Boolean>)ancient_city,trial_chambers,mansion) and leave common ones on.StructureGenerationListenerCancels
AsyncStructureSpawnEventfor 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-Citymatchesancient_city).Also
config.ymldocuments the new section with the list of accepted structure keys.pom.xml— bumpbuild.versionto 1.23.0.Notes
@ConfigEntryfields; both are provided for the new map.trueor 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