| 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 | import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList;
|
| 11 |
|
| 12 | public class BastionBridgePools {
|
| 13 | public static void bootstrap(final BootstrapContext<StructureTemplatePool> context) {
|
| 14 | HolderGetter<StructureProcessorList> processorLists = context.lookup(Registries.PROCESSOR_LIST);
|
| 15 | Holder<StructureProcessorList> entranceReplacement = processorLists.getOrThrow(ProcessorLists.ENTRANCE_REPLACEMENT);
|
| 16 | Holder<StructureProcessorList> bastionGenericDegradation = processorLists.getOrThrow(ProcessorLists.BASTION_GENERIC_DEGRADATION);
|
| 17 | Holder<StructureProcessorList> bridge = processorLists.getOrThrow(ProcessorLists.BRIDGE);
|
| 18 | Holder<StructureProcessorList> rampartDegradation = processorLists.getOrThrow(ProcessorLists.RAMPART_DEGRADATION);
|
| 19 | HolderGetter<StructureTemplatePool> pools = context.lookup(Registries.TEMPLATE_POOL);
|
| 20 | Holder<StructureTemplatePool> empty = pools.getOrThrow(Pools.EMPTY);
|
| 21 | Pools.register(
|
| 22 | context,
|
| 23 | "bastion/bridge/starting_pieces",
|
| 24 | new StructureTemplatePool(
|
| 25 | empty,
|
| 26 | ImmutableList.of(
|
| 27 | Pair.of(StructurePoolElement.single("bastion/bridge/starting_pieces/entrance", entranceReplacement), 1),
|
| 28 | Pair.of(StructurePoolElement.single("bastion/bridge/starting_pieces/entrance_face", bastionGenericDegradation), 1)
|
| 29 | ),
|
| 30 | StructureTemplatePool.Projection.RIGID
|
| 31 | )
|
| 32 | );
|
| 33 | Pools.register(
|
| 34 | context,
|
| 35 | "bastion/bridge/bridge_pieces",
|
| 36 | new StructureTemplatePool(
|
| 37 | empty, ImmutableList.of(Pair.of(StructurePoolElement.single("bastion/bridge/bridge_pieces/bridge", bridge), 1)), StructureTemplatePool.Projection.RIGID
|
| 38 | )
|
| 39 | );
|
| 40 | Pools.register(
|
| 41 | context,
|
| 42 | "bastion/bridge/legs",
|
| 43 | new StructureTemplatePool(
|
| 44 | empty,
|
| 45 | ImmutableList.of(
|
| 46 | Pair.of(StructurePoolElement.single("bastion/bridge/legs/leg_0", bastionGenericDegradation), 1),
|
| 47 | Pair.of(StructurePoolElement.single("bastion/bridge/legs/leg_1", bastionGenericDegradation), 1)
|
| 48 | ),
|
| 49 | StructureTemplatePool.Projection.RIGID
|
| 50 | )
|
| 51 | );
|
| 52 | Pools.register(
|
| 53 | context,
|
| 54 | "bastion/bridge/walls",
|
| 55 | new StructureTemplatePool(
|
| 56 | empty,
|
| 57 | ImmutableList.of(
|
| 58 | Pair.of(StructurePoolElement.single("bastion/bridge/walls/wall_base_0", rampartDegradation), 1),
|
| 59 | Pair.of(StructurePoolElement.single("bastion/bridge/walls/wall_base_1", rampartDegradation), 1)
|
| 60 | ),
|
| 61 | StructureTemplatePool.Projection.RIGID
|
| 62 | )
|
| 63 | );
|
| 64 | Pools.register(
|
| 65 | context,
|
| 66 | "bastion/bridge/ramparts",
|
| 67 | new StructureTemplatePool(
|
| 68 | empty,
|
| 69 | ImmutableList.of(
|
| 70 | Pair.of(StructurePoolElement.single("bastion/bridge/ramparts/rampart_0", rampartDegradation), 1),
|
| 71 | Pair.of(StructurePoolElement.single("bastion/bridge/ramparts/rampart_1", rampartDegradation), 1)
|
| 72 | ),
|
| 73 | StructureTemplatePool.Projection.RIGID
|
| 74 | )
|
| 75 | );
|
| 76 | Pools.register(
|
| 77 | context,
|
| 78 | "bastion/bridge/rampart_plates",
|
| 79 | new StructureTemplatePool(
|
| 80 | empty,
|
| 81 | ImmutableList.of(Pair.of(StructurePoolElement.single("bastion/bridge/rampart_plates/plate_0", rampartDegradation), 1)),
|
| 82 | StructureTemplatePool.Projection.RIGID
|
| 83 | )
|
| 84 | );
|
| 85 | Pools.register(
|
| 86 | context,
|
| 87 | "bastion/bridge/connectors",
|
| 88 | new StructureTemplatePool(
|
| 89 | empty,
|
| 90 | ImmutableList.of(
|
| 91 | Pair.of(StructurePoolElement.single("bastion/bridge/connectors/back_bridge_top", bastionGenericDegradation), 1),
|
| 92 | Pair.of(StructurePoolElement.single("bastion/bridge/connectors/back_bridge_bottom", bastionGenericDegradation), 1)
|
| 93 | ),
|
| 94 | StructureTemplatePool.Projection.RIGID
|
| 95 | )
|
| 96 | );
|
| 97 | }
|
| 98 | }
|
| 99 |
|