/locate finds Duloc and Shrek's Swamp #2

Merged
Bewerkt merged 1 commit from feature/locate-structures into main 2026-10-22 09:51:10 +00:00
Owner

/locate structure perfectplace:duloc and ... perfectplace:shreks_swamp found nothing: both use SingleNearOriginPlacement, and vanilla only walks concentric-ring and random-spread placements, so it never asks the mod where its structures are.

  • New mixin/ChunkGeneratorLocateMixin.java injects into ChunkGenerator.findNearestMapStructure and asks PPStructures.locateGenerated when the placed set uses one of our placements.
  • New compat/world/StructureCompat.java hides getStartForStructure losing SectionPos in 26.x.
  • /locate keeps working for every vanilla structure.

Known limitation: a tag that mixes a mod structure and a vanilla one returns the mod's structure even when the vanilla one is closer.

Builds green on all six nodes (CI run #6); the mixin has not been exercised on a running server yet.

`/locate structure perfectplace:duloc` and `... perfectplace:shreks_swamp` found nothing: both use `SingleNearOriginPlacement`, and vanilla only walks concentric-ring and random-spread placements, so it never asks the mod where its structures are. - New `mixin/ChunkGeneratorLocateMixin.java` injects into `ChunkGenerator.findNearestMapStructure` and asks `PPStructures.locateGenerated` when the placed set uses one of our placements. - New `compat/world/StructureCompat.java` hides `getStartForStructure` losing `SectionPos` in 26.x. - `/locate` keeps working for every vanilla structure. Known limitation: a tag that mixes a mod structure and a vanilla one returns the mod's structure even when the vanilla one is closer. Builds green on all six nodes (CI run #6); the mixin has not been exercised on a running server yet.
Let /locate find Duloc and Shrek's swamp
All checks were successful
Build / Build all versions and loaders (push) Successful in 4m58s
Build / Build all versions and loaders (pull_request) Successful in 5m11s
7359a19c07
Vanilla's structure search only collects placements it knows how to walk: concentric rings (strongholds) and
random spread. Every other placement is skipped before it can become a candidate, which is why /locate
answered "not found" for the two single-per-world structures.

A mixin on ChunkGenerator.findNearestMapStructure now answers for SingleNearOriginPlacement before vanilla
runs: it takes the chunk the placement picked, generates that chunk's structure starts the way vanilla does,
and returns the structure start when it is valid. Anything else, and a request for our structures that finds
nothing, falls through to vanilla unchanged.

StructureCompat hides the one API difference on the way: getStartForStructure lost its SectionPos argument in
26.x. The README gains the two command lines; RELEASE_NOTES loses the limitation that no longer applies.
Bewerkt deleted branch feature/locate-structures 2026-10-22 09:53:38 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Bewerkt/ThePerfectPlaceMod!2
No description provided.