JungleTemplePiece .java

net.minecraft.world.level.levelgen.structure.structures.JungleTemplePiece (class): members: MossStoneSelector, placedHiddenChest, placedMainChest, DEPTH.

net.minecraft.world.level.levelgen.structure.structuresclass369 linescommonextends ScatteredFeaturePiece17.4 KB

API Surface (3)

void addAdditionalSaveData(final StructurePieceSerializationContext context, final CompoundTag tag)
void postProcess(final WorldGenLevel level, final StructureManager structureManager, final ChunkGenerator generator, final RandomSource random, final BoundingBox chunkBB, final ChunkPos chunkPos, final BlockPos referencePos)
void next(final RandomSource random, final int worldX, final int worldY, final int worldZ, final boolean isEdge)

Fields & Constants (13)

WIDTH
DEPTH
STONE_SELECTOR
placedMainChest
placedHiddenChest
placedTrap1
placedTrap2
level
structureManager
generator
random
chunkBB
chunkPos

String literals (4)

"placedMainChest"
"placedHiddenChest"
"placedTrap1"
"placedTrap2"

Full Source

JungleTemplePiece.java369 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.levelgen.structure.structures;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.core.Direction;
5
import net.minecraft.nbt.CompoundTag;
6
import net.minecraft.util.RandomSource;
7
import net.minecraft.world.level.ChunkPos;
8
import net.minecraft.world.level.StructureManager;
9
import net.minecraft.world.level.WorldGenLevel;
10
import net.minecraft.world.level.block.Blocks;
11
import net.minecraft.world.level.block.LeverBlock;
12
import net.minecraft.world.level.block.RedstoneWireBlock;
13
import net.minecraft.world.level.block.RepeaterBlock;
14
import net.minecraft.world.level.block.StairBlock;
15
import net.minecraft.world.level.block.TripWireBlock;
16
import net.minecraft.world.level.block.TripWireHookBlock;
17
import net.minecraft.world.level.block.VineBlock;
18
import net.minecraft.world.level.block.piston.PistonBaseBlock;
19
import net.minecraft.world.level.block.state.BlockState;
20
import net.minecraft.world.level.block.state.properties.AttachFace;
21
import net.minecraft.world.level.block.state.properties.RedstoneSide;
22
import net.minecraft.world.level.chunk.ChunkGenerator;
23
import net.minecraft.world.level.levelgen.structure.BoundingBox;
24
import net.minecraft.world.level.levelgen.structure.ScatteredFeaturePiece;
25
import net.minecraft.world.level.levelgen.structure.StructurePiece;
26
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext;
27
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
28
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
29
30
public class JungleTemplePiece extends ScatteredFeaturePiece {
31
	public static final int WIDTH = 12;
32
	public static final int DEPTH = 15;
33
	private boolean placedMainChest;
34
	private boolean placedHiddenChest;
35
	private boolean placedTrap1;
36
	private boolean placedTrap2;
37
	private static final JungleTemplePiece.MossStoneSelector STONE_SELECTOR = new JungleTemplePiece.MossStoneSelector();
38
39
	public JungleTemplePiece(final RandomSource random, final int west, final int north) {
40
		super(StructurePieceType.JUNGLE_PYRAMID_PIECE, west, 64, north, 12, 10, 15, getRandomHorizontalDirection(random));
41
	}
42
43
	public JungleTemplePiece(final CompoundTag tag) {
44
		super(StructurePieceType.JUNGLE_PYRAMID_PIECE, tag);
45
		this.placedMainChest = tag.getBooleanOr("placedMainChest", false);
46
		this.placedHiddenChest = tag.getBooleanOr("placedHiddenChest", false);
47
		this.placedTrap1 = tag.getBooleanOr("placedTrap1", false);
48
		this.placedTrap2 = tag.getBooleanOr("placedTrap2", false);
49
	}
50
51
	@Override
52
	protected void addAdditionalSaveData(final StructurePieceSerializationContext context, final CompoundTag tag) {
53
		super.addAdditionalSaveData(context, tag);
54
		tag.putBoolean("placedMainChest", this.placedMainChest);
55
		tag.putBoolean("placedHiddenChest", this.placedHiddenChest);
56
		tag.putBoolean("placedTrap1", this.placedTrap1);
57
		tag.putBoolean("placedTrap2", this.placedTrap2);
58
	}
59
60
	@Override
61
	public void postProcess(
62
		final WorldGenLevel level,
63
		final StructureManager structureManager,
64
		final ChunkGenerator generator,
65
		final RandomSource random,
66
		final BoundingBox chunkBB,
67
		final ChunkPos chunkPos,
68
		final BlockPos referencePos
69
	) {
70
		if (this.updateAverageGroundHeight(level, chunkBB, 0)) {
71
			this.generateBox(level, chunkBB, 0, -4, 0, this.width - 1, 0, this.depth - 1, false, random, STONE_SELECTOR);
72
			this.generateBox(level, chunkBB, 2, 1, 2, 9, 2, 2, false, random, STONE_SELECTOR);
73
			this.generateBox(level, chunkBB, 2, 1, 12, 9, 2, 12, false, random, STONE_SELECTOR);
74
			this.generateBox(level, chunkBB, 2, 1, 3, 2, 2, 11, false, random, STONE_SELECTOR);
75
			this.generateBox(level, chunkBB, 9, 1, 3, 9, 2, 11, false, random, STONE_SELECTOR);
76
			this.generateBox(level, chunkBB, 1, 3, 1, 10, 6, 1, false, random, STONE_SELECTOR);
77
			this.generateBox(level, chunkBB, 1, 3, 13, 10, 6, 13, false, random, STONE_SELECTOR);
78
			this.generateBox(level, chunkBB, 1, 3, 2, 1, 6, 12, false, random, STONE_SELECTOR);
79
			this.generateBox(level, chunkBB, 10, 3, 2, 10, 6, 12, false, random, STONE_SELECTOR);
80
			this.generateBox(level, chunkBB, 2, 3, 2, 9, 3, 12, false, random, STONE_SELECTOR);
81
			this.generateBox(level, chunkBB, 2, 6, 2, 9, 6, 12, false, random, STONE_SELECTOR);
82
			this.generateBox(level, chunkBB, 3, 7, 3, 8, 7, 11, false, random, STONE_SELECTOR);
83
			this.generateBox(level, chunkBB, 4, 8, 4, 7, 8, 10, false, random, STONE_SELECTOR);
84
			this.generateAirBox(level, chunkBB, 3, 1, 3, 8, 2, 11);
85
			this.generateAirBox(level, chunkBB, 4, 3, 6, 7, 3, 9);
86
			this.generateAirBox(level, chunkBB, 2, 4, 2, 9, 5, 12);
87
			this.generateAirBox(level, chunkBB, 4, 6, 5, 7, 6, 9);
88
			this.generateAirBox(level, chunkBB, 5, 7, 6, 6, 7, 8);
89
			this.generateAirBox(level, chunkBB, 5, 1, 2, 6, 2, 2);
90
			this.generateAirBox(level, chunkBB, 5, 2, 12, 6, 2, 12);
91
			this.generateAirBox(level, chunkBB, 5, 5, 1, 6, 5, 1);
92
			this.generateAirBox(level, chunkBB, 5, 5, 13, 6, 5, 13);
93
			this.placeBlock(level, Blocks.AIR.defaultBlockState(), 1, 5, 5, chunkBB);
94
			this.placeBlock(level, Blocks.AIR.defaultBlockState(), 10, 5, 5, chunkBB);
95
			this.placeBlock(level, Blocks.AIR.defaultBlockState(), 1, 5, 9, chunkBB);
96
			this.placeBlock(level, Blocks.AIR.defaultBlockState(), 10, 5, 9, chunkBB);
97
98
			for (int z = 0; z <= 14; z += 14) {
99
				this.generateBox(level, chunkBB, 2, 4, z, 2, 5, z, false, random, STONE_SELECTOR);
100
				this.generateBox(level, chunkBB, 4, 4, z, 4, 5, z, false, random, STONE_SELECTOR);
101
				this.generateBox(level, chunkBB, 7, 4, z, 7, 5, z, false, random, STONE_SELECTOR);
102
				this.generateBox(level, chunkBB, 9, 4, z, 9, 5, z, false, random, STONE_SELECTOR);
103
			}
104
105
			this.generateBox(level, chunkBB, 5, 6, 0, 6, 6, 0, false, random, STONE_SELECTOR);
106
107
			for (int x = 0; x <= 11; x += 11) {
108
				for (int z = 2; z <= 12; z += 2) {
109
					this.generateBox(level, chunkBB, x, 4, z, x, 5, z, false, random, STONE_SELECTOR);
110
				}
111
112
				this.generateBox(level, chunkBB, x, 6, 5, x, 6, 5, false, random, STONE_SELECTOR);
113
				this.generateBox(level, chunkBB, x, 6, 9, x, 6, 9, false, random, STONE_SELECTOR);
114
			}
115
116
			this.generateBox(level, chunkBB, 2, 7, 2, 2, 9, 2, false, random, STONE_SELECTOR);
117
			this.generateBox(level, chunkBB, 9, 7, 2, 9, 9, 2, false, random, STONE_SELECTOR);
118
			this.generateBox(level, chunkBB, 2, 7, 12, 2, 9, 12, false, random, STONE_SELECTOR);
119
			this.generateBox(level, chunkBB, 9, 7, 12, 9, 9, 12, false, random, STONE_SELECTOR);
120
			this.generateBox(level, chunkBB, 4, 9, 4, 4, 9, 4, false, random, STONE_SELECTOR);
121
			this.generateBox(level, chunkBB, 7, 9, 4, 7, 9, 4, false, random, STONE_SELECTOR);
122
			this.generateBox(level, chunkBB, 4, 9, 10, 4, 9, 10, false, random, STONE_SELECTOR);
123
			this.generateBox(level, chunkBB, 7, 9, 10, 7, 9, 10, false, random, STONE_SELECTOR);
124
			this.generateBox(level, chunkBB, 5, 9, 7, 6, 9, 7, false, random, STONE_SELECTOR);
125
			BlockState eastStairs = Blocks.COBBLESTONE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.EAST);
126
			BlockState westStairs = Blocks.COBBLESTONE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.WEST);
127
			BlockState southStairs = Blocks.COBBLESTONE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.SOUTH);
128
			BlockState northStairs = Blocks.COBBLESTONE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.NORTH);
129
			this.placeBlock(level, northStairs, 5, 9, 6, chunkBB);
130
			this.placeBlock(level, northStairs, 6, 9, 6, chunkBB);
131
			this.placeBlock(level, southStairs, 5, 9, 8, chunkBB);
132
			this.placeBlock(level, southStairs, 6, 9, 8, chunkBB);
133
			this.placeBlock(level, northStairs, 4, 0, 0, chunkBB);
134
			this.placeBlock(level, northStairs, 5, 0, 0, chunkBB);
135
			this.placeBlock(level, northStairs, 6, 0, 0, chunkBB);
136
			this.placeBlock(level, northStairs, 7, 0, 0, chunkBB);
137
			this.placeBlock(level, northStairs, 4, 1, 8, chunkBB);
138
			this.placeBlock(level, northStairs, 4, 2, 9, chunkBB);
139
			this.placeBlock(level, northStairs, 4, 3, 10, chunkBB);
140
			this.placeBlock(level, northStairs, 7, 1, 8, chunkBB);
141
			this.placeBlock(level, northStairs, 7, 2, 9, chunkBB);
142
			this.placeBlock(level, northStairs, 7, 3, 10, chunkBB);
143
			this.generateBox(level, chunkBB, 4, 1, 9, 4, 1, 9, false, random, STONE_SELECTOR);
144
			this.generateBox(level, chunkBB, 7, 1, 9, 7, 1, 9, false, random, STONE_SELECTOR);
145
			this.generateBox(level, chunkBB, 4, 1, 10, 7, 2, 10, false, random, STONE_SELECTOR);
146
			this.generateBox(level, chunkBB, 5, 4, 5, 6, 4, 5, false, random, STONE_SELECTOR);
147
			this.placeBlock(level, eastStairs, 4, 4, 5, chunkBB);
148
			this.placeBlock(level, westStairs, 7, 4, 5, chunkBB);
149
150
			for (int i = 0; i < 4; i++) {
151
				this.placeBlock(level, southStairs, 5, 0 - i, 6 + i, chunkBB);
152
				this.placeBlock(level, southStairs, 6, 0 - i, 6 + i, chunkBB);
153
				this.generateAirBox(level, chunkBB, 5, 0 - i, 7 + i, 6, 0 - i, 9 + i);
154
			}
155
156
			this.generateAirBox(level, chunkBB, 1, -3, 12, 10, -1, 13);
157
			this.generateAirBox(level, chunkBB, 1, -3, 1, 3, -1, 13);
158
			this.generateAirBox(level, chunkBB, 1, -3, 1, 9, -1, 5);
159
160
			for (int z = 1; z <= 13; z += 2) {
161
				this.generateBox(level, chunkBB, 1, -3, z, 1, -2, z, false, random, STONE_SELECTOR);
162
			}
163
164
			for (int z = 2; z <= 12; z += 2) {
165
				this.generateBox(level, chunkBB, 1, -1, z, 3, -1, z, false, random, STONE_SELECTOR);
166
			}
167
168
			this.generateBox(level, chunkBB, 2, -2, 1, 5, -2, 1, false, random, STONE_SELECTOR);
169
			this.generateBox(level, chunkBB, 7, -2, 1, 9, -2, 1, false, random, STONE_SELECTOR);
170
			this.generateBox(level, chunkBB, 6, -3, 1, 6, -3, 1, false, random, STONE_SELECTOR);
171
			this.generateBox(level, chunkBB, 6, -1, 1, 6, -1, 1, false, random, STONE_SELECTOR);
172
			this.placeBlock(
173
				level,
174
				Blocks.TRIPWIRE_HOOK.defaultBlockState().setValue(TripWireHookBlock.FACING, Direction.EAST).setValue(TripWireHookBlock.ATTACHED, true),
175
				1,
176
				-3,
177
				8,
178
				chunkBB
179
			);
180
			this.placeBlock(
181
				level,
182
				Blocks.TRIPWIRE_HOOK.defaultBlockState().setValue(TripWireHookBlock.FACING, Direction.WEST).setValue(TripWireHookBlock.ATTACHED, true),
183
				4,
184
				-3,
185
				8,
186
				chunkBB
187
			);
188
			this.placeBlock(
189
				level,
190
				Blocks.TRIPWIRE.defaultBlockState().setValue(TripWireBlock.EAST, true).setValue(TripWireBlock.WEST, true).setValue(TripWireBlock.ATTACHED, true),
191
				2,
192
				-3,
193
				8,
194
				chunkBB
195
			);
196
			this.placeBlock(
197
				level,
198
				Blocks.TRIPWIRE.defaultBlockState().setValue(TripWireBlock.EAST, true).setValue(TripWireBlock.WEST, true).setValue(TripWireBlock.ATTACHED, true),
199
				3,
200
				-3,
201
				8,
202
				chunkBB
203
			);
204
			BlockState redstoneWireNS = Blocks.REDSTONE_WIRE
205
				.defaultBlockState()
206
				.setValue(RedstoneWireBlock.NORTH, RedstoneSide.SIDE)
207
				.setValue(RedstoneWireBlock.SOUTH, RedstoneSide.SIDE);
208
			this.placeBlock(level, redstoneWireNS, 5, -3, 7, chunkBB);
209
			this.placeBlock(level, redstoneWireNS, 5, -3, 6, chunkBB);
210
			this.placeBlock(level, redstoneWireNS, 5, -3, 5, chunkBB);
211
			this.placeBlock(level, redstoneWireNS, 5, -3, 4, chunkBB);
212
			this.placeBlock(level, redstoneWireNS, 5, -3, 3, chunkBB);
213
			this.placeBlock(level, redstoneWireNS, 5, -3, 2, chunkBB);
214
			this.placeBlock(
215
				level,
216
				Blocks.REDSTONE_WIRE.defaultBlockState().setValue(RedstoneWireBlock.NORTH, RedstoneSide.SIDE).setValue(RedstoneWireBlock.WEST, RedstoneSide.SIDE),
217
				5,
218
				-3,
219
				1,
220
				chunkBB
221
			);
222
			this.placeBlock(
223
				level,
224
				Blocks.REDSTONE_WIRE.defaultBlockState().setValue(RedstoneWireBlock.EAST, RedstoneSide.SIDE).setValue(RedstoneWireBlock.WEST, RedstoneSide.SIDE),
225
				4,
226
				-3,
227
				1,
228
				chunkBB
229
			);
230
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 3, -3, 1, chunkBB);
231
			if (!this.placedTrap1) {
232
				this.placedTrap1 = this.createDispenser(level, chunkBB, random, 3, -2, 1, Direction.NORTH, BuiltInLootTables.JUNGLE_TEMPLE_DISPENSER);
233
			}
234
235
			this.placeBlock(level, Blocks.VINE.defaultBlockState().setValue(VineBlock.SOUTH, true), 3, -2, 2, chunkBB);
236
			this.placeBlock(
237
				level,
238
				Blocks.TRIPWIRE_HOOK.defaultBlockState().setValue(TripWireHookBlock.FACING, Direction.NORTH).setValue(TripWireHookBlock.ATTACHED, true),
239
				7,
240
				-3,
241
				1,
242
				chunkBB
243
			);
244
			this.placeBlock(
245
				level,
246
				Blocks.TRIPWIRE_HOOK.defaultBlockState().setValue(TripWireHookBlock.FACING, Direction.SOUTH).setValue(TripWireHookBlock.ATTACHED, true),
247
				7,
248
				-3,
249
				5,
250
				chunkBB
251
			);
252
			this.placeBlock(
253
				level,
254
				Blocks.TRIPWIRE.defaultBlockState().setValue(TripWireBlock.NORTH, true).setValue(TripWireBlock.SOUTH, true).setValue(TripWireBlock.ATTACHED, true),
255
				7,
256
				-3,
257
				2,
258
				chunkBB
259
			);
260
			this.placeBlock(
261
				level,
262
				Blocks.TRIPWIRE.defaultBlockState().setValue(TripWireBlock.NORTH, true).setValue(TripWireBlock.SOUTH, true).setValue(TripWireBlock.ATTACHED, true),
263
				7,
264
				-3,
265
				3,
266
				chunkBB
267
			);
268
			this.placeBlock(
269
				level,
270
				Blocks.TRIPWIRE.defaultBlockState().setValue(TripWireBlock.NORTH, true).setValue(TripWireBlock.SOUTH, true).setValue(TripWireBlock.ATTACHED, true),
271
				7,
272
				-3,
273
				4,
274
				chunkBB
275
			);
276
			this.placeBlock(
277
				level,
278
				Blocks.REDSTONE_WIRE.defaultBlockState().setValue(RedstoneWireBlock.EAST, RedstoneSide.SIDE).setValue(RedstoneWireBlock.WEST, RedstoneSide.SIDE),
279
				8,
280
				-3,
281
				6,
282
				chunkBB
283
			);
284
			this.placeBlock(
285
				level,
286
				Blocks.REDSTONE_WIRE.defaultBlockState().setValue(RedstoneWireBlock.WEST, RedstoneSide.SIDE).setValue(RedstoneWireBlock.SOUTH, RedstoneSide.SIDE),
287
				9,
288
				-3,
289
				6,
290
				chunkBB
291
			);
292
			this.placeBlock(
293
				level,
294
				Blocks.REDSTONE_WIRE.defaultBlockState().setValue(RedstoneWireBlock.NORTH, RedstoneSide.SIDE).setValue(RedstoneWireBlock.SOUTH, RedstoneSide.UP),
295
				9,
296
				-3,
297
				5,
298
				chunkBB
299
			);
300
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 9, -3, 4, chunkBB);
301
			this.placeBlock(level, redstoneWireNS, 9, -2, 4, chunkBB);
302
			if (!this.placedTrap2) {
303
				this.placedTrap2 = this.createDispenser(level, chunkBB, random, 9, -2, 3, Direction.WEST, BuiltInLootTables.JUNGLE_TEMPLE_DISPENSER);
304
			}
305
306
			this.placeBlock(level, Blocks.VINE.defaultBlockState().setValue(VineBlock.EAST, true), 8, -1, 3, chunkBB);
307
			this.placeBlock(level, Blocks.VINE.defaultBlockState().setValue(VineBlock.EAST, true), 8, -2, 3, chunkBB);
308
			if (!this.placedMainChest) {
309
				this.placedMainChest = this.createChest(level, chunkBB, random, 8, -3, 3, BuiltInLootTables.JUNGLE_TEMPLE);
310
			}
311
312
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 9, -3, 2, chunkBB);
313
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 8, -3, 1, chunkBB);
314
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 4, -3, 5, chunkBB);
315
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 5, -2, 5, chunkBB);
316
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 5, -1, 5, chunkBB);
317
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 6, -3, 5, chunkBB);
318
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 7, -2, 5, chunkBB);
319
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 7, -1, 5, chunkBB);
320
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 8, -3, 5, chunkBB);
321
			this.generateBox(level, chunkBB, 9, -1, 1, 9, -1, 5, false, random, STONE_SELECTOR);
322
			this.generateAirBox(level, chunkBB, 8, -3, 8, 10, -1, 10);
323
			this.placeBlock(level, Blocks.CHISELED_STONE_BRICKS.defaultBlockState(), 8, -2, 11, chunkBB);
324
			this.placeBlock(level, Blocks.CHISELED_STONE_BRICKS.defaultBlockState(), 9, -2, 11, chunkBB);
325
			this.placeBlock(level, Blocks.CHISELED_STONE_BRICKS.defaultBlockState(), 10, -2, 11, chunkBB);
326
			BlockState lever = Blocks.LEVER.defaultBlockState().setValue(LeverBlock.FACING, Direction.NORTH).setValue(LeverBlock.FACE, AttachFace.WALL);
327
			this.placeBlock(level, lever, 8, -2, 12, chunkBB);
328
			this.placeBlock(level, lever, 9, -2, 12, chunkBB);
329
			this.placeBlock(level, lever, 10, -2, 12, chunkBB);
330
			this.generateBox(level, chunkBB, 8, -3, 8, 8, -3, 10, false, random, STONE_SELECTOR);
331
			this.generateBox(level, chunkBB, 10, -3, 8, 10, -3, 10, false, random, STONE_SELECTOR);
332
			this.placeBlock(level, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 10, -2, 9, chunkBB);
333
			this.placeBlock(level, redstoneWireNS, 8, -2, 9, chunkBB);
334
			this.placeBlock(level, redstoneWireNS, 8, -2, 10, chunkBB);
335
			this.placeBlock(
336
				level,
337
				Blocks.REDSTONE_WIRE
338
					.defaultBlockState()
339
					.setValue(RedstoneWireBlock.NORTH, RedstoneSide.SIDE)
340
					.setValue(RedstoneWireBlock.SOUTH, RedstoneSide.SIDE)
341
					.setValue(RedstoneWireBlock.EAST, RedstoneSide.SIDE)
342
					.setValue(RedstoneWireBlock.WEST, RedstoneSide.SIDE),
343
				10,
344
				-1,
345
				9,
346
				chunkBB
347
			);
348
			this.placeBlock(level, Blocks.STICKY_PISTON.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.UP), 9, -2, 8, chunkBB);
349
			this.placeBlock(level, Blocks.STICKY_PISTON.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.WEST), 10, -2, 8, chunkBB);
350
			this.placeBlock(level, Blocks.STICKY_PISTON.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.WEST), 10, -1, 8, chunkBB);
351
			this.placeBlock(level, Blocks.REPEATER.defaultBlockState().setValue(RepeaterBlock.FACING, Direction.NORTH), 10, -2, 10, chunkBB);
352
			if (!this.placedHiddenChest) {
353
				this.placedHiddenChest = this.createChest(level, chunkBB, random, 9, -3, 10, BuiltInLootTables.JUNGLE_TEMPLE);
354
			}
355
		}
356
	}
357
358
	private static class MossStoneSelector extends StructurePiece.BlockSelector {
359
		@Override
360
		public void next(final RandomSource random, final int worldX, final int worldY, final int worldZ, final boolean isEdge) {
361
			if (random.nextFloat() < 0.4F) {
362
				this.next = Blocks.COBBLESTONE.defaultBlockState();
363
			} else {
364
				this.next = Blocks.MOSSY_COBBLESTONE.defaultBlockState();
365
			}
366
		}
367
	}
368
}
369

Decompiled Minecraft 26.3 source of JungleTemplePiece (net/minecraft/world/level/levelgen/structure/structures/JungleTemplePiece.java) with Mojang official mappings, stored verbatim on the site.