AncientCityStructurePieces .java

net.minecraft.data.worldgen.AncientCityStructurePieces (class, 36 lines): members: START, bootstrap. strings: "ancient_city/city_center/city_center_1".

net.minecraft.data.worldgenclass36 linescommon1.7 KB

API Surface (1)

void bootstrap(final BootstrapContext<StructureTemplatePool> context)

Fields & Constants (1)

START

String literals (4)

"ancient_city/city_center"
"ancient_city/city_center/city_center_1"
"ancient_city/city_center/city_center_2"
"ancient_city/city_center/city_center_3"

Full Source

AncientCityStructurePieces.java36 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.data.worldgen;
2
3
import com.google.common.collect.ImmutableList;
4
import com.mojang.datafixers.util.Pair;
5
import net.minecraft.core.Holder;
6
import net.minecraft.core.HolderGetter;
7
import net.minecraft.core.registries.Registries;
8
import net.minecraft.resources.ResourceKey;
9
import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement;
10
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
11
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList;
12
13
public class AncientCityStructurePieces {
14
	public static final ResourceKey<StructureTemplatePool> START = Pools.createKey("ancient_city/city_center");
15
16
	public static void bootstrap(final BootstrapContext<StructureTemplatePool> context) {
17
		HolderGetter<StructureProcessorList> processorLists = context.lookup(Registries.PROCESSOR_LIST);
18
		Holder<StructureProcessorList> ancientCityStartDegradation = processorLists.getOrThrow(ProcessorLists.ANCIENT_CITY_START_DEGRADATION);
19
		HolderGetter<StructureTemplatePool> pools = context.lookup(Registries.TEMPLATE_POOL);
20
		Holder<StructureTemplatePool> empty = pools.getOrThrow(Pools.EMPTY);
21
		context.register(
22
			START,
23
			new StructureTemplatePool(
24
				empty,
25
				ImmutableList.of(
26
					Pair.of(StructurePoolElement.single("ancient_city/city_center/city_center_1", ancientCityStartDegradation), 1),
27
					Pair.of(StructurePoolElement.single("ancient_city/city_center/city_center_2", ancientCityStartDegradation), 1),
28
					Pair.of(StructurePoolElement.single("ancient_city/city_center/city_center_3", ancientCityStartDegradation), 1)
29
				),
30
				StructureTemplatePool.Projection.RIGID
31
			)
32
		);
33
		AncientCityStructurePools.bootstrap(context);
34
	}
35
}
36

Decompiled Minecraft 26.3 source of AncientCityStructurePieces (net/minecraft/data/worldgen/AncientCityStructurePieces.java) with Mojang official mappings, stored verbatim on the site.