| 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 PillagerOutpostPools {
|
| 14 | public static final ResourceKey<StructureTemplatePool> START = Pools.createKey("pillager_outpost/base_plates");
|
| 15 |
|
| 16 | public static void bootstrap(final BootstrapContext<StructureTemplatePool> context) {
|
| 17 | HolderGetter<StructureProcessorList> processorLists = context.lookup(Registries.PROCESSOR_LIST);
|
| 18 | Holder<StructureProcessorList> outpostRot = processorLists.getOrThrow(ProcessorLists.OUTPOST_ROT);
|
| 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, ImmutableList.of(Pair.of(StructurePoolElement.legacy("pillager_outpost/base_plate"), 1)), StructureTemplatePool.Projection.RIGID
|
| 25 | )
|
| 26 | );
|
| 27 | Pools.register(
|
| 28 | context,
|
| 29 | "pillager_outpost/towers",
|
| 30 | new StructureTemplatePool(
|
| 31 | empty,
|
| 32 | ImmutableList.of(
|
| 33 | Pair.of(
|
| 34 | StructurePoolElement.list(
|
| 35 | ImmutableList.of(
|
| 36 | StructurePoolElement.legacy("pillager_outpost/watchtower"), StructurePoolElement.legacy("pillager_outpost/watchtower_overgrown", outpostRot)
|
| 37 | )
|
| 38 | ),
|
| 39 | 1
|
| 40 | )
|
| 41 | ),
|
| 42 | StructureTemplatePool.Projection.RIGID
|
| 43 | )
|
| 44 | );
|
| 45 | Pools.register(
|
| 46 | context,
|
| 47 | "pillager_outpost/feature_plates",
|
| 48 | new StructureTemplatePool(
|
| 49 | empty, ImmutableList.of(Pair.of(StructurePoolElement.legacy("pillager_outpost/feature_plate"), 1)), StructureTemplatePool.Projection.TERRAIN_MATCHING
|
| 50 | )
|
| 51 | );
|
| 52 | Pools.register(
|
| 53 | context,
|
| 54 | "pillager_outpost/features",
|
| 55 | new StructureTemplatePool(
|
| 56 | empty,
|
| 57 | ImmutableList.of(
|
| 58 | Pair.of(StructurePoolElement.legacy("pillager_outpost/feature_cage1"), 1),
|
| 59 | Pair.of(StructurePoolElement.legacy("pillager_outpost/feature_cage2"), 1),
|
| 60 | Pair.of(StructurePoolElement.legacy("pillager_outpost/feature_cage_with_allays"), 1),
|
| 61 | Pair.of(StructurePoolElement.legacy("pillager_outpost/feature_logs"), 1),
|
| 62 | Pair.of(StructurePoolElement.legacy("pillager_outpost/feature_tent1"), 1),
|
| 63 | Pair.of(StructurePoolElement.legacy("pillager_outpost/feature_tent2"), 1),
|
| 64 | Pair.of(StructurePoolElement.legacy("pillager_outpost/feature_targets"), 1),
|
| 65 | Pair.of(StructurePoolElement.empty(), 6)
|
| 66 | ),
|
| 67 | StructureTemplatePool.Projection.RIGID
|
| 68 | )
|
| 69 | );
|
| 70 | }
|
| 71 | }
|
| 72 |
|