package net.minecraft.world.level.levelgen.structure;

import net.minecraft.world.level.block.state.AbstractStateHolder;
import net.minecraft.world.level.block.RepeaterBlock;
import net.minecraft.world.level.block.piston.PistonBaseBlock;
import net.minecraft.world.level.block.state.properties.AttachFace;
import net.minecraft.world.level.block.LeverBlock;
import net.minecraft.world.level.block.VineBlock;
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
import net.minecraft.world.level.block.state.properties.RedstoneSide;
import net.minecraft.world.level.block.RedStoneWireBlock;
import net.minecraft.world.level.block.TripWireBlock;
import net.minecraft.world.level.block.TripWireHookBlock;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.StairBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
import net.minecraft.world.level.levelgen.feature.StructurePieceType;
import java.util.Random;

public class JunglePyramidPiece extends ScatteredFeaturePiece {
    private boolean placedMainChest;
    private boolean placedHiddenChest;
    private boolean placedTrap1;
    private boolean placedTrap2;
    private static final MossStoneSelector STONE_SELECTOR;
    
    public JunglePyramidPiece(final Random random, final int integer2, final int integer3) {
        super(StructurePieceType.JUNGLE_PYRAMID_PIECE, random, integer2, 64, integer3, 12, 10, 15);
    }
    
    public JunglePyramidPiece(final StructureManager cmo, final CompoundTag jt) {
        super(StructurePieceType.JUNGLE_PYRAMID_PIECE, jt);
        this.placedMainChest = jt.getBoolean("placedMainChest");
        this.placedHiddenChest = jt.getBoolean("placedHiddenChest");
        this.placedTrap1 = jt.getBoolean("placedTrap1");
        this.placedTrap2 = jt.getBoolean("placedTrap2");
    }
    
    @Override
    protected void addAdditionalSaveData(final CompoundTag jt) {
        super.addAdditionalSaveData(jt);
        jt.putBoolean("placedMainChest", this.placedMainChest);
        jt.putBoolean("placedHiddenChest", this.placedHiddenChest);
        jt.putBoolean("placedTrap1", this.placedTrap1);
        jt.putBoolean("placedTrap2", this.placedTrap2);
    }
    
    @Override
    public boolean postProcess(final LevelAccessor bjx, final ChunkGenerator<?> caa, final Random random, final BoundingBox clb, final ChunkPos bjh) {
        if (!this.updateAverageGroundHeight(bjx, clb, 0)) {
            return false;
        }
        this.generateBox(bjx, clb, 0, -4, 0, this.width - 1, 0, this.depth - 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 2, 1, 2, 9, 2, 2, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 2, 1, 12, 9, 2, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 2, 1, 3, 2, 2, 11, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 9, 1, 3, 9, 2, 11, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 1, 3, 1, 10, 6, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 1, 3, 13, 10, 6, 13, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 1, 3, 2, 1, 6, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 10, 3, 2, 10, 6, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 2, 3, 2, 9, 3, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 2, 6, 2, 9, 6, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 3, 7, 3, 8, 7, 11, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 4, 8, 4, 7, 8, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateAirBox(bjx, clb, 3, 1, 3, 8, 2, 11);
        this.generateAirBox(bjx, clb, 4, 3, 6, 7, 3, 9);
        this.generateAirBox(bjx, clb, 2, 4, 2, 9, 5, 12);
        this.generateAirBox(bjx, clb, 4, 6, 5, 7, 6, 9);
        this.generateAirBox(bjx, clb, 5, 7, 6, 6, 7, 8);
        this.generateAirBox(bjx, clb, 5, 1, 2, 6, 2, 2);
        this.generateAirBox(bjx, clb, 5, 2, 12, 6, 2, 12);
        this.generateAirBox(bjx, clb, 5, 5, 1, 6, 5, 1);
        this.generateAirBox(bjx, clb, 5, 5, 13, 6, 5, 13);
        this.placeBlock(bjx, Blocks.AIR.defaultBlockState(), 1, 5, 5, clb);
        this.placeBlock(bjx, Blocks.AIR.defaultBlockState(), 10, 5, 5, clb);
        this.placeBlock(bjx, Blocks.AIR.defaultBlockState(), 1, 5, 9, clb);
        this.placeBlock(bjx, Blocks.AIR.defaultBlockState(), 10, 5, 9, clb);
        for (int integer7 = 0; integer7 <= 14; integer7 += 14) {
            this.generateBox(bjx, clb, 2, 4, integer7, 2, 5, integer7, false, random, JunglePyramidPiece.STONE_SELECTOR);
            this.generateBox(bjx, clb, 4, 4, integer7, 4, 5, integer7, false, random, JunglePyramidPiece.STONE_SELECTOR);
            this.generateBox(bjx, clb, 7, 4, integer7, 7, 5, integer7, false, random, JunglePyramidPiece.STONE_SELECTOR);
            this.generateBox(bjx, clb, 9, 4, integer7, 9, 5, integer7, false, random, JunglePyramidPiece.STONE_SELECTOR);
        }
        this.generateBox(bjx, clb, 5, 6, 0, 6, 6, 0, false, random, JunglePyramidPiece.STONE_SELECTOR);
        for (int integer7 = 0; integer7 <= 11; integer7 += 11) {
            for (int integer8 = 2; integer8 <= 12; integer8 += 2) {
                this.generateBox(bjx, clb, integer7, 4, integer8, integer7, 5, integer8, false, random, JunglePyramidPiece.STONE_SELECTOR);
            }
            this.generateBox(bjx, clb, integer7, 6, 5, integer7, 6, 5, false, random, JunglePyramidPiece.STONE_SELECTOR);
            this.generateBox(bjx, clb, integer7, 6, 9, integer7, 6, 9, false, random, JunglePyramidPiece.STONE_SELECTOR);
        }
        this.generateBox(bjx, clb, 2, 7, 2, 2, 9, 2, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 9, 7, 2, 9, 9, 2, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 2, 7, 12, 2, 9, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 9, 7, 12, 9, 9, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 4, 9, 4, 4, 9, 4, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 7, 9, 4, 7, 9, 4, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 4, 9, 10, 4, 9, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 7, 9, 10, 7, 9, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 5, 9, 7, 6, 9, 7, false, random, JunglePyramidPiece.STONE_SELECTOR);
        final BlockState byj7 = ((AbstractStateHolder<O, BlockState>)Blocks.COBBLESTONE_STAIRS.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)StairBlock.FACING, Direction.EAST);
        final BlockState byj8 = ((AbstractStateHolder<O, BlockState>)Blocks.COBBLESTONE_STAIRS.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)StairBlock.FACING, Direction.WEST);
        final BlockState byj9 = ((AbstractStateHolder<O, BlockState>)Blocks.COBBLESTONE_STAIRS.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)StairBlock.FACING, Direction.SOUTH);
        final BlockState byj10 = ((AbstractStateHolder<O, BlockState>)Blocks.COBBLESTONE_STAIRS.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)StairBlock.FACING, Direction.NORTH);
        this.placeBlock(bjx, byj10, 5, 9, 6, clb);
        this.placeBlock(bjx, byj10, 6, 9, 6, clb);
        this.placeBlock(bjx, byj9, 5, 9, 8, clb);
        this.placeBlock(bjx, byj9, 6, 9, 8, clb);
        this.placeBlock(bjx, byj10, 4, 0, 0, clb);
        this.placeBlock(bjx, byj10, 5, 0, 0, clb);
        this.placeBlock(bjx, byj10, 6, 0, 0, clb);
        this.placeBlock(bjx, byj10, 7, 0, 0, clb);
        this.placeBlock(bjx, byj10, 4, 1, 8, clb);
        this.placeBlock(bjx, byj10, 4, 2, 9, clb);
        this.placeBlock(bjx, byj10, 4, 3, 10, clb);
        this.placeBlock(bjx, byj10, 7, 1, 8, clb);
        this.placeBlock(bjx, byj10, 7, 2, 9, clb);
        this.placeBlock(bjx, byj10, 7, 3, 10, clb);
        this.generateBox(bjx, clb, 4, 1, 9, 4, 1, 9, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 7, 1, 9, 7, 1, 9, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 4, 1, 10, 7, 2, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 5, 4, 5, 6, 4, 5, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.placeBlock(bjx, byj7, 4, 4, 5, clb);
        this.placeBlock(bjx, byj8, 7, 4, 5, clb);
        for (int integer9 = 0; integer9 < 4; ++integer9) {
            this.placeBlock(bjx, byj9, 5, 0 - integer9, 6 + integer9, clb);
            this.placeBlock(bjx, byj9, 6, 0 - integer9, 6 + integer9, clb);
            this.generateAirBox(bjx, clb, 5, 0 - integer9, 7 + integer9, 6, 0 - integer9, 9 + integer9);
        }
        this.generateAirBox(bjx, clb, 1, -3, 12, 10, -1, 13);
        this.generateAirBox(bjx, clb, 1, -3, 1, 3, -1, 13);
        this.generateAirBox(bjx, clb, 1, -3, 1, 9, -1, 5);
        for (int integer9 = 1; integer9 <= 13; integer9 += 2) {
            this.generateBox(bjx, clb, 1, -3, integer9, 1, -2, integer9, false, random, JunglePyramidPiece.STONE_SELECTOR);
        }
        for (int integer9 = 2; integer9 <= 12; integer9 += 2) {
            this.generateBox(bjx, clb, 1, -1, integer9, 3, -1, integer9, false, random, JunglePyramidPiece.STONE_SELECTOR);
        }
        this.generateBox(bjx, clb, 2, -2, 1, 5, -2, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 7, -2, 1, 9, -2, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 6, -3, 1, 6, -3, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 6, -1, 1, 6, -1, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.placeBlock(bjx, (((AbstractStateHolder<O, BlockState>)Blocks.TRIPWIRE_HOOK.defaultBlockState()).setValue((Property<Comparable>)TripWireHookBlock.FACING, Direction.EAST)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireHookBlock.ATTACHED, true), 1, -3, 8, clb);
        this.placeBlock(bjx, (((AbstractStateHolder<O, BlockState>)Blocks.TRIPWIRE_HOOK.defaultBlockState()).setValue((Property<Comparable>)TripWireHookBlock.FACING, Direction.WEST)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireHookBlock.ATTACHED, true), 4, -3, 8, clb);
        this.placeBlock(bjx, ((((AbstractStateHolder<O, BlockState>)Blocks.TRIPWIRE.defaultBlockState()).setValue((Property<Comparable>)TripWireBlock.EAST, true)).setValue((Property<Comparable>)TripWireBlock.WEST, true)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireBlock.ATTACHED, true), 2, -3, 8, clb);
        this.placeBlock(bjx, ((((AbstractStateHolder<O, BlockState>)Blocks.TRIPWIRE.defaultBlockState()).setValue((Property<Comparable>)TripWireBlock.EAST, true)).setValue((Property<Comparable>)TripWireBlock.WEST, true)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireBlock.ATTACHED, true), 3, -3, 8, clb);
        final BlockState byj11 = (((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.NORTH, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.SOUTH, RedstoneSide.SIDE);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.SOUTH, RedstoneSide.SIDE), 5, -3, 7, clb);
        this.placeBlock(bjx, byj11, 5, -3, 6, clb);
        this.placeBlock(bjx, byj11, 5, -3, 5, clb);
        this.placeBlock(bjx, byj11, 5, -3, 4, clb);
        this.placeBlock(bjx, byj11, 5, -3, 3, clb);
        this.placeBlock(bjx, byj11, 5, -3, 2, clb);
        this.placeBlock(bjx, (((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.NORTH, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.WEST, RedstoneSide.SIDE), 5, -3, 1, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.EAST, RedstoneSide.SIDE), 4, -3, 1, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 3, -3, 1, clb);
        if (!this.placedTrap1) {
            this.placedTrap1 = this.createDispenser(bjx, clb, random, 3, -2, 1, Direction.NORTH, BuiltInLootTables.JUNGLE_TEMPLE_DISPENSER);
        }
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.VINE.defaultBlockState()).<Comparable, Boolean>setValue((Property<Comparable>)VineBlock.SOUTH, true), 3, -2, 2, clb);
        this.placeBlock(bjx, (((AbstractStateHolder<O, BlockState>)Blocks.TRIPWIRE_HOOK.defaultBlockState()).setValue((Property<Comparable>)TripWireHookBlock.FACING, Direction.NORTH)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireHookBlock.ATTACHED, true), 7, -3, 1, clb);
        this.placeBlock(bjx, (((AbstractStateHolder<O, BlockState>)Blocks.TRIPWIRE_HOOK.defaultBlockState()).setValue((Property<Comparable>)TripWireHookBlock.FACING, Direction.SOUTH)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireHookBlock.ATTACHED, true), 7, -3, 5, clb);
        this.placeBlock(bjx, ((((AbstractStateHolder<O, BlockState>)Blocks.TRIPWIRE.defaultBlockState()).setValue((Property<Comparable>)TripWireBlock.NORTH, true)).setValue((Property<Comparable>)TripWireBlock.SOUTH, true)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireBlock.ATTACHED, true), 7, -3, 2, clb);
        this.placeBlock(bjx, ((((AbstractStateHolder<O, BlockState>)Blocks.TRIPWIRE.defaultBlockState()).setValue((Property<Comparable>)TripWireBlock.NORTH, true)).setValue((Property<Comparable>)TripWireBlock.SOUTH, true)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireBlock.ATTACHED, true), 7, -3, 3, clb);
        this.placeBlock(bjx, ((((AbstractStateHolder<O, BlockState>)Blocks.TRIPWIRE.defaultBlockState()).setValue((Property<Comparable>)TripWireBlock.NORTH, true)).setValue((Property<Comparable>)TripWireBlock.SOUTH, true)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireBlock.ATTACHED, true), 7, -3, 4, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.EAST, RedstoneSide.SIDE), 8, -3, 6, clb);
        this.placeBlock(bjx, (((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.WEST, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.SOUTH, RedstoneSide.SIDE), 9, -3, 6, clb);
        this.placeBlock(bjx, (((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.NORTH, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.SOUTH, RedstoneSide.UP), 9, -3, 5, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 9, -3, 4, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.NORTH, RedstoneSide.SIDE), 9, -2, 4, clb);
        if (!this.placedTrap2) {
            this.placedTrap2 = this.createDispenser(bjx, clb, random, 9, -2, 3, Direction.WEST, BuiltInLootTables.JUNGLE_TEMPLE_DISPENSER);
        }
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.VINE.defaultBlockState()).<Comparable, Boolean>setValue((Property<Comparable>)VineBlock.EAST, true), 8, -1, 3, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.VINE.defaultBlockState()).<Comparable, Boolean>setValue((Property<Comparable>)VineBlock.EAST, true), 8, -2, 3, clb);
        if (!this.placedMainChest) {
            this.placedMainChest = this.createChest(bjx, clb, random, 8, -3, 3, BuiltInLootTables.JUNGLE_TEMPLE);
        }
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 9, -3, 2, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 8, -3, 1, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 4, -3, 5, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 5, -2, 5, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 5, -1, 5, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 6, -3, 5, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 7, -2, 5, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 7, -1, 5, clb);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 8, -3, 5, clb);
        this.generateBox(bjx, clb, 9, -1, 1, 9, -1, 5, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateAirBox(bjx, clb, 8, -3, 8, 10, -1, 10);
        this.placeBlock(bjx, Blocks.CHISELED_STONE_BRICKS.defaultBlockState(), 8, -2, 11, clb);
        this.placeBlock(bjx, Blocks.CHISELED_STONE_BRICKS.defaultBlockState(), 9, -2, 11, clb);
        this.placeBlock(bjx, Blocks.CHISELED_STONE_BRICKS.defaultBlockState(), 10, -2, 11, clb);
        final BlockState byj12 = (((AbstractStateHolder<O, BlockState>)Blocks.LEVER.defaultBlockState()).setValue((Property<Comparable>)LeverBlock.FACING, Direction.NORTH)).<AttachFace, AttachFace>setValue(LeverBlock.FACE, AttachFace.WALL);
        this.placeBlock(bjx, byj12, 8, -2, 12, clb);
        this.placeBlock(bjx, byj12, 9, -2, 12, clb);
        this.placeBlock(bjx, byj12, 10, -2, 12, clb);
        this.generateBox(bjx, clb, 8, -3, 8, 8, -3, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bjx, clb, 10, -3, 8, 10, -3, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.placeBlock(bjx, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 10, -2, 9, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.NORTH, RedstoneSide.SIDE), 8, -2, 9, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.SOUTH, RedstoneSide.SIDE), 8, -2, 10, clb);
        this.placeBlock(bjx, Blocks.REDSTONE_WIRE.defaultBlockState(), 10, -1, 9, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.STICKY_PISTON.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)PistonBaseBlock.FACING, Direction.UP), 9, -2, 8, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.STICKY_PISTON.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)PistonBaseBlock.FACING, Direction.WEST), 10, -2, 8, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.STICKY_PISTON.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)PistonBaseBlock.FACING, Direction.WEST), 10, -1, 8, clb);
        this.placeBlock(bjx, ((AbstractStateHolder<O, BlockState>)Blocks.REPEATER.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)RepeaterBlock.FACING, Direction.NORTH), 10, -2, 10, clb);
        if (!this.placedHiddenChest) {
            this.placedHiddenChest = this.createChest(bjx, clb, random, 9, -3, 10, BuiltInLootTables.JUNGLE_TEMPLE);
        }
        return true;
    }
    
    static {
        STONE_SELECTOR = new MossStoneSelector();
    }
    
    static class MossStoneSelector extends BlockSelector {
        private MossStoneSelector() {
        }
        
        @Override
        public void next(final Random random, final int integer2, final int integer3, final int integer4, final boolean boolean5) {
            if (random.nextFloat() < 0.4f) {
                this.next = Blocks.COBBLESTONE.defaultBlockState();
            }
            else {
                this.next = Blocks.MOSSY_COBBLESTONE.defaultBlockState();
            }
        }
    }
}
