Release 1.23.1#119
Merged
Merged
Conversation
Disabling a structure in `world.structures` cancels its AsyncStructureSpawnEvent so it never gets placed, but leaves the world's structure placement rules untouched. Every structure search — the /locate command, Eyes of Ender, explorer/treasure maps, dolphins and villager map trades — therefore keeps proposing candidate positions that are all cancelled, so the search can never succeed and scans out to the radius cap. On a test world, `/locate structure minecraft:trial_chambers` generated ~1,500 cancelled structure starts and froze the main thread for 62 seconds, tripping the Watchdog. Handle Paper's StructuresLocateEvent (fired before any structure search) to remove disabled structures from the search list, and cancel outright when nothing remains, so the search returns "not found" instantly instead of scanning. Enabled structures and searches in other worlds are untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GBGsNFUshypm5Sj8KQsEa
…e-116 Stop /locate freezing the server for disabled structures (#116)
The structure listener was registered in onEnable(), but createWorlds() runs before onEnable() and generating a world also generates its spawn-area chunks. Those first structures were therefore placed before the listener existed, so a disabled structure could still appear near spawn. Register the listener at the start of createWorlds(), before any world is created. Because createWorlds() assigns islandWorld from the return value of createWorld(), the island-world reference is still null while the spawn chunks generate, so inWorld() would compare against a null world and throw. Match on the configured world name instead via a new isCaveOverworld() helper, used by both handlers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GBGsNFUshypm5Sj8KQsEa
Suppress structures in the spawn area too (#116)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates CaveBlock’s structure handling to prevent disabled structures from being located (e.g., /locate, explorer maps) in the CaveBlock overworld, addressing a main-thread freeze scenario, and ensures the structure listener is active early enough to cover spawn-area generation.
Changes:
- Add a
StructuresLocateEventhandler to remove disabled structures from locate searches (or cancel searches when all targets are disabled). - Register
StructureGenerationListenerearlier duringcreateWorlds()so it applies before initial spawn chunks generate. - Expand unit tests for locate behavior and bump the build version to 1.23.1.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/test/java/world/bentobox/caveblock/listeners/StructureGenerationListenerTest.java | Adds tests for StructuresLocateEvent behavior and updates world matching setup. |
| src/main/java/world/bentobox/caveblock/listeners/StructureGenerationListener.java | Implements locate filtering/cancellation and updates world matching logic for early-worldgen timing. |
| src/main/java/world/bentobox/caveblock/CaveBlock.java | Moves listener registration into createWorlds() so it runs before initial chunk/structure generation. |
| pom.xml | Bumps build version to 1.23.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- StructureGenerationListener: collect allowed structures into a mutable ArrayList so StructuresLocateEvent#setStructures() gets a list Paper (or a later listener) can still mutate; Stream#toList() is unmodifiable. - Test: drop the redundant Structure cast and build the mock structure list as a mutable ArrayList, mirroring Paper's mutable getStructures(). - CLAUDE.md: refresh the architecture section for the current generators, populators, and the new StructureGenerationListener. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GBGsNFUshypm5Sj8KQsEa
|
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.



No description provided.