BastionPieces .java

net.minecraft.data.worldgen.BastionPieces (class): members: START, bootstrap. strings: "bastion/bridge/starting_pieces/entrance_base", "bastion/starts".

net.minecraft.data.worldgenclass41 linescommon1.9 KB

API Surface (1)

void bootstrap(final BootstrapContext<StructureTemplatePool> context)

Fields & Constants (1)

START

String literals (5)

"bastion/starts"
"bastion/units/air_base"
"bastion/hoglin_stable/air_base"
"bastion/treasure/big_air_full"
"bastion/bridge/starting_pieces/entrance_base"

Full Source

BastionPieces.java41 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 BastionPieces {
14
	public static final ResourceKey<StructureTemplatePool> START = Pools.createKey("bastion/starts");
15
16
	public static void bootstrap(final BootstrapContext<StructureTemplatePool> context) {
17
		HolderGetter<StructureProcessorList> processorLists = context.lookup(Registries.PROCESSOR_LIST);
18
		Holder<StructureProcessorList> bastionGenericDegradation = processorLists.getOrThrow(ProcessorLists.BASTION_GENERIC_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("bastion/units/air_base", bastionGenericDegradation), 1),
27
					Pair.of(StructurePoolElement.single("bastion/hoglin_stable/air_base", bastionGenericDegradation), 1),
28
					Pair.of(StructurePoolElement.single("bastion/treasure/big_air_full", bastionGenericDegradation), 1),
29
					Pair.of(StructurePoolElement.single("bastion/bridge/starting_pieces/entrance_base", bastionGenericDegradation), 1)
30
				),
31
				StructureTemplatePool.Projection.RIGID
32
			)
33
		);
34
		BastionHousingUnitsPools.bootstrap(context);
35
		BastionHoglinStablePools.bootstrap(context);
36
		BastionTreasureRoomPools.bootstrap(context);
37
		BastionBridgePools.bootstrap(context);
38
		BastionSharedPools.bootstrap(context);
39
	}
40
}
41

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