File size: 20,626 Bytes
d46f4a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
package net.minecraft.data.worldgen;

import com.google.common.collect.ImmutableList;
import com.mojang.datafixers.util.Pair;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.placement.VillagePlacements;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement;
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList;

public class SavannaVillagePools {
    public static final ResourceKey<StructureTemplatePool> START = Pools.createKey("village/savanna/town_centers");
    private static final ResourceKey<StructureTemplatePool> TERMINATORS_KEY = Pools.createKey("village/savanna/terminators");
    private static final ResourceKey<StructureTemplatePool> ZOMBIE_TERMINATORS_KEY = Pools.createKey("village/savanna/zombie/terminators");

    public static void bootstrap(BootstrapContext<StructureTemplatePool> p_327770_) {
        HolderGetter<PlacedFeature> holdergetter = p_327770_.lookup(Registries.PLACED_FEATURE);
        Holder<PlacedFeature> holder = holdergetter.getOrThrow(VillagePlacements.ACACIA_VILLAGE);
        Holder<PlacedFeature> holder1 = holdergetter.getOrThrow(VillagePlacements.PILE_HAY_VILLAGE);
        Holder<PlacedFeature> holder2 = holdergetter.getOrThrow(VillagePlacements.PILE_MELON_VILLAGE);
        HolderGetter<StructureProcessorList> holdergetter1 = p_327770_.lookup(Registries.PROCESSOR_LIST);
        Holder<StructureProcessorList> holder3 = holdergetter1.getOrThrow(ProcessorLists.ZOMBIE_SAVANNA);
        Holder<StructureProcessorList> holder4 = holdergetter1.getOrThrow(ProcessorLists.STREET_SAVANNA);
        Holder<StructureProcessorList> holder5 = holdergetter1.getOrThrow(ProcessorLists.FARM_SAVANNA);
        HolderGetter<StructureTemplatePool> holdergetter2 = p_327770_.lookup(Registries.TEMPLATE_POOL);
        Holder<StructureTemplatePool> holder6 = holdergetter2.getOrThrow(Pools.EMPTY);
        Holder<StructureTemplatePool> holder7 = holdergetter2.getOrThrow(TERMINATORS_KEY);
        Holder<StructureTemplatePool> holder8 = holdergetter2.getOrThrow(ZOMBIE_TERMINATORS_KEY);
        p_327770_.register(
            START,
            new StructureTemplatePool(
                holder6,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/savanna/town_centers/savanna_meeting_point_1"), 100),
                    Pair.of(StructurePoolElement.legacy("village/savanna/town_centers/savanna_meeting_point_2"), 50),
                    Pair.of(StructurePoolElement.legacy("village/savanna/town_centers/savanna_meeting_point_3"), 150),
                    Pair.of(StructurePoolElement.legacy("village/savanna/town_centers/savanna_meeting_point_4"), 150),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/town_centers/savanna_meeting_point_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/town_centers/savanna_meeting_point_2", holder3), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/town_centers/savanna_meeting_point_3", holder3), 3),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/town_centers/savanna_meeting_point_4", holder3), 3)
                ),
                StructureTemplatePool.Projection.RIGID
            )
        );
        Pools.register(
            p_327770_,
            "village/savanna/streets",
            new StructureTemplatePool(
                holder7,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/corner_01", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/corner_03", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/straight_02", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/straight_04", holder4), 7),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/straight_05", holder4), 3),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/straight_06", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/straight_08", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/straight_09", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/straight_10", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/straight_11", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/crossroad_02", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/crossroad_03", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/crossroad_04", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/crossroad_05", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/crossroad_06", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/crossroad_07", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/split_01", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/split_02", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/streets/turn_01", holder4), 3)
                ),
                StructureTemplatePool.Projection.TERRAIN_MATCHING
            )
        );
        Pools.register(
            p_327770_,
            "village/savanna/zombie/streets",
            new StructureTemplatePool(
                holder8,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/corner_01", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/corner_03", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/straight_02", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/straight_04", holder4), 7),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/straight_05", holder4), 3),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/straight_06", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/straight_08", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/straight_09", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/straight_10", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/straight_11", holder4), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/crossroad_02", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/crossroad_03", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/crossroad_04", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/crossroad_05", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/crossroad_06", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/crossroad_07", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/split_01", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/split_02", holder4), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/streets/turn_01", holder4), 3)
                ),
                StructureTemplatePool.Projection.TERRAIN_MATCHING
            )
        );
        Pools.register(
            p_327770_,
            "village/savanna/houses",
            new StructureTemplatePool(
                holder7,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_house_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_house_2"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_house_3"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_house_4"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_house_5"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_house_6"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_house_7"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_house_8"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_medium_house_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_medium_house_2"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_butchers_shop_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_butchers_shop_2"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_tool_smith_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_fletcher_house_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_shepherd_1"), 7),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_armorer_1"), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_fisher_cottage_1"), 3),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_tannery_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_cartographer_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_library_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_mason_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_weaponsmith_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_weaponsmith_2"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_temple_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_temple_2"), 3),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_large_farm_1", holder5), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_large_farm_2", holder5), 6),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_farm", holder5), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_animal_pen_1"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_animal_pen_2"), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_animal_pen_3"), 2),
                    Pair.of(StructurePoolElement.empty(), 5)
                ),
                StructureTemplatePool.Projection.RIGID
            )
        );
        Pools.register(
            p_327770_,
            "village/savanna/zombie/houses",
            new StructureTemplatePool(
                holder8,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_small_house_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_small_house_2", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_small_house_3", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_small_house_4", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_small_house_5", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_small_house_6", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_small_house_7", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_small_house_8", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_medium_house_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_medium_house_2", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_butchers_shop_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_butchers_shop_2", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_tool_smith_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_fletcher_house_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_shepherd_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_armorer_1", holder3), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_fisher_cottage_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_tannery_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_cartographer_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_library_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_mason_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_weaponsmith_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_weaponsmith_2", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_temple_1", holder3), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_temple_2", holder3), 3),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_large_farm_1", holder3), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_large_farm_2", holder3), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_small_farm", holder3), 4),
                    Pair.of(StructurePoolElement.legacy("village/savanna/houses/savanna_animal_pen_1", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_animal_pen_2", holder3), 2),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/houses/savanna_animal_pen_3", holder3), 2),
                    Pair.of(StructurePoolElement.empty(), 5)
                ),
                StructureTemplatePool.Projection.RIGID
            )
        );
        p_327770_.register(
            TERMINATORS_KEY,
            new StructureTemplatePool(
                holder6,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/plains/terminators/terminator_01", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/plains/terminators/terminator_02", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/plains/terminators/terminator_03", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/plains/terminators/terminator_04", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/terminators/terminator_05", holder4), 1)
                ),
                StructureTemplatePool.Projection.TERRAIN_MATCHING
            )
        );
        p_327770_.register(
            ZOMBIE_TERMINATORS_KEY,
            new StructureTemplatePool(
                holder6,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/plains/terminators/terminator_01", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/plains/terminators/terminator_02", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/plains/terminators/terminator_03", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/plains/terminators/terminator_04", holder4), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/terminators/terminator_05", holder4), 1)
                ),
                StructureTemplatePool.Projection.TERRAIN_MATCHING
            )
        );
        Pools.register(
            p_327770_,
            "village/savanna/trees",
            new StructureTemplatePool(holder6, ImmutableList.of(Pair.of(StructurePoolElement.feature(holder), 1)), StructureTemplatePool.Projection.RIGID)
        );
        Pools.register(
            p_327770_,
            "village/savanna/decor",
            new StructureTemplatePool(
                holder6,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/savanna/savanna_lamp_post_01"), 4),
                    Pair.of(StructurePoolElement.feature(holder), 4),
                    Pair.of(StructurePoolElement.feature(holder1), 4),
                    Pair.of(StructurePoolElement.feature(holder2), 1),
                    Pair.of(StructurePoolElement.empty(), 4)
                ),
                StructureTemplatePool.Projection.RIGID
            )
        );
        Pools.register(
            p_327770_,
            "village/savanna/zombie/decor",
            new StructureTemplatePool(
                holder6,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/savanna/savanna_lamp_post_01", holder3), 4),
                    Pair.of(StructurePoolElement.feature(holder), 4),
                    Pair.of(StructurePoolElement.feature(holder1), 4),
                    Pair.of(StructurePoolElement.feature(holder2), 1),
                    Pair.of(StructurePoolElement.empty(), 4)
                ),
                StructureTemplatePool.Projection.RIGID
            )
        );
        Pools.register(
            p_327770_,
            "village/savanna/villagers",
            new StructureTemplatePool(
                holder6,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/savanna/villagers/nitwit"), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/villagers/baby"), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/villagers/unemployed"), 10)
                ),
                StructureTemplatePool.Projection.RIGID
            )
        );
        Pools.register(
            p_327770_,
            "village/savanna/zombie/villagers",
            new StructureTemplatePool(
                holder6,
                ImmutableList.of(
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/villagers/nitwit"), 1),
                    Pair.of(StructurePoolElement.legacy("village/savanna/zombie/villagers/unemployed"), 10)
                ),
                StructureTemplatePool.Projection.RIGID
            )
        );
    }
}