Skip to content

Release 1.23.1#119

Merged
tastybento merged 6 commits into
masterfrom
develop
Jul 9, 2026
Merged

Release 1.23.1#119
tastybento merged 6 commits into
masterfrom
develop

Conversation

@tastybento

Copy link
Copy Markdown
Member

No description provided.

tastybento and others added 5 commits July 9, 2026 07:20
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StructuresLocateEvent handler to remove disabled structures from locate searches (or cancel searches when all targets are disabled).
  • Register StructureGenerationListener earlier during createWorlds() 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
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@tastybento tastybento merged commit 1d14270 into master Jul 9, 2026
4 checks passed
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.

2 participants