Pools .java

net.minecraft.data.worldgen.Pools (class, 43 lines): members: parseKey, createKey, EMPTY, register, bootstrap. strings: "empty". imports: HolderGetter.

net.minecraft.data.worldgenclass43 linescommon1.7 KB

API Surface (5)

ResourceKey<StructureTemplatePool> createKey(final Identifier location)
ResourceKey<StructureTemplatePool> createKey(final String name)
ResourceKey<StructureTemplatePool> parseKey(final String name)
void register(final BootstrapContext<StructureTemplatePool> context, final String name, final StructureTemplatePool pool)
void bootstrap(final BootstrapContext<StructureTemplatePool> context)

Fields & Constants (1)

EMPTY

String literals (1)

"empty"

Full Source

Pools.java43 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.data.worldgen;
2
3
import com.google.common.collect.ImmutableList;
4
import net.minecraft.core.Holder;
5
import net.minecraft.core.HolderGetter;
6
import net.minecraft.core.registries.Registries;
7
import net.minecraft.resources.Identifier;
8
import net.minecraft.resources.ResourceKey;
9
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
10
11
public class Pools {
12
	public static final ResourceKey<StructureTemplatePool> EMPTY = createKey("empty");
13
14
	public static ResourceKey<StructureTemplatePool> createKey(final Identifier location) {
15
		return ResourceKey.create(Registries.TEMPLATE_POOL, location);
16
	}
17
18
	public static ResourceKey<StructureTemplatePool> createKey(final String name) {
19
		return createKey(Identifier.withDefaultNamespace(name));
20
	}
21
22
	public static ResourceKey<StructureTemplatePool> parseKey(final String name) {
23
		return createKey(Identifier.parse(name));
24
	}
25
26
	public static void register(final BootstrapContext<StructureTemplatePool> context, final String name, final StructureTemplatePool pool) {
27
		context.register(createKey(name), pool);
28
	}
29
30
	public static void bootstrap(final BootstrapContext<StructureTemplatePool> context) {
31
		HolderGetter<StructureTemplatePool> pools = context.lookup(Registries.TEMPLATE_POOL);
32
		Holder<StructureTemplatePool> empty = pools.getOrThrow(EMPTY);
33
		context.register(EMPTY, new StructureTemplatePool(empty, ImmutableList.of(), StructureTemplatePool.Projection.RIGID));
34
		BastionPieces.bootstrap(context);
35
		PillagerOutpostPools.bootstrap(context);
36
		VillagePools.bootstrap(context);
37
		AncientCityStructurePieces.bootstrap(context);
38
		TrailRuinsStructurePools.bootstrap(context);
39
		TrialChambersStructurePools.bootstrap(context);
40
		AbandonedCampStructurePools.bootstrap(context);
41
	}
42
}
43

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