BastionSharedPools .java

net.minecraft.data.worldgen.BastionSharedPools (class, 62 lines): members: bootstrap. strings: "bastion/mobs/melee_piglin_always", "bastion/blocks/gold".

net.minecraft.data.worldgenclass62 linescommon2.1 KB

API Surface (1)

void bootstrap(final BootstrapContext<StructureTemplatePool> context)

String literals (10)

"bastion/mobs/piglin"
"bastion/mobs/melee_piglin"
"bastion/mobs/sword_piglin"
"bastion/mobs/crossbow_piglin"
"bastion/mobs/empty"
"bastion/mobs/hoglin"
"bastion/blocks/gold"
"bastion/blocks/air"
"bastion/mobs/piglin_melee"
"bastion/mobs/melee_piglin_always"

Code Graph: Dependencies (7)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

BastionSharedPools.java62 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.world.level.levelgen.structure.pools.StructurePoolElement;
9
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
10
11
public class BastionSharedPools {
12
	public static void bootstrap(final BootstrapContext<StructureTemplatePool> context) {
13
		HolderGetter<StructureTemplatePool> pools = context.lookup(Registries.TEMPLATE_POOL);
14
		Holder<StructureTemplatePool> empty = pools.getOrThrow(Pools.EMPTY);
15
		Pools.register(
16
			context,
17
			"bastion/mobs/piglin",
18
			new StructureTemplatePool(
19
				empty,
20
				ImmutableList.of(
21
					Pair.of(StructurePoolElement.single("bastion/mobs/melee_piglin"), 1),
22
					Pair.of(StructurePoolElement.single("bastion/mobs/sword_piglin"), 4),
23
					Pair.of(StructurePoolElement.single("bastion/mobs/crossbow_piglin"), 4),
24
					Pair.of(StructurePoolElement.single("bastion/mobs/empty"), 1)
25
				),
26
				StructureTemplatePool.Projection.RIGID
27
			)
28
		);
29
		Pools.register(
30
			context,
31
			"bastion/mobs/hoglin",
32
			new StructureTemplatePool(
33
				empty,
34
				ImmutableList.of(Pair.of(StructurePoolElement.single("bastion/mobs/hoglin"), 2), Pair.of(StructurePoolElement.single("bastion/mobs/empty"), 1)),
35
				StructureTemplatePool.Projection.RIGID
36
			)
37
		);
38
		Pools.register(
39
			context,
40
			"bastion/blocks/gold",
41
			new StructureTemplatePool(
42
				empty,
43
				ImmutableList.of(Pair.of(StructurePoolElement.single("bastion/blocks/air"), 3), Pair.of(StructurePoolElement.single("bastion/blocks/gold"), 1)),
44
				StructureTemplatePool.Projection.RIGID
45
			)
46
		);
47
		Pools.register(
48
			context,
49
			"bastion/mobs/piglin_melee",
50
			new StructureTemplatePool(
51
				empty,
52
				ImmutableList.of(
53
					Pair.of(StructurePoolElement.single("bastion/mobs/melee_piglin_always"), 1),
54
					Pair.of(StructurePoolElement.single("bastion/mobs/melee_piglin"), 5),
55
					Pair.of(StructurePoolElement.single("bastion/mobs/sword_piglin"), 1)
56
				),
57
				StructureTemplatePool.Projection.RIGID
58
			)
59
		);
60
	}
61
}
62

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