Generate structure entities and add /locate structure

Structure templates now place their saved entities (StructureTemplate.placeEntities: moved, turned and mirrored with the template, finalized for jigsaw pieces, ignored for mansions and end cities), carried in the proto chunk and spawned with the chunk: villages get their villagers and animals. /locate structure (an id or a #tag) searches ring and random-spread placements like ChunkGenerator.findNearestMapStructure; seed 42 matches vanilla for villages, monuments, swamp huts, igloos, strongholds and outposts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-09 09:01:55 +02:00
parent 3c9d804ebb
commit 382eb0b74b
15 changed files with 489 additions and 9 deletions
@@ -1346,6 +1346,13 @@ impl ArgType {
ArgType::ItemPredicate => Arg::Item(parse_item(reader, reg, true)?),
ArgType::BlockState => Arg::Block(parse_block(reader, reg, false)?),
ArgType::BlockPredicate => Arg::Block(parse_block(reader, reg, true)?),
// ResourceOrTagKeyArgument: structures and biomes also take a #tag.
ArgType::Resource(kind @ (Resource::Structure | Resource::Biome))
if reader.can_read() && reader.peek() == '#' =>
{
reader.cursor += 1;
Arg::Resource(format!("#{}", read_id(reader)?))
}
ArgType::Resource(kind) => {
let id = read_id(reader)?;
let values = kind.values(reg);