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

import net.minecraft.world.level.block.state.StateHolder;
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.LevelAccessor;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.StructureFeatureManager;
import net.minecraft.world.level.WorldGenLevel;
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 cva, final CompoundTag le) {
        super(StructurePieceType.JUNGLE_PYRAMID_PIECE, le);
        this.placedMainChest = le.getBoolean("placedMainChest");
        this.placedHiddenChest = le.getBoolean("placedHiddenChest");
        this.placedTrap1 = le.getBoolean("placedTrap1");
        this.placedTrap2 = le.getBoolean("placedTrap2");
    }
    
    @Override
    protected void addAdditionalSaveData(final CompoundTag le) {
        super.addAdditionalSaveData(le);
        le.putBoolean("placedMainChest", this.placedMainChest);
        le.putBoolean("placedHiddenChest", this.placedHiddenChest);
        le.putBoolean("placedTrap1", this.placedTrap1);
        le.putBoolean("placedTrap2", this.placedTrap2);
    }
    
    @Override
    public boolean postProcess(final WorldGenLevel bqu, final StructureFeatureManager bqq, final ChunkGenerator cha, final Random random, final BoundingBox ctd, final ChunkPos bph, final BlockPos fu) {
        if (!this.updateAverageGroundHeight(bqu, ctd, 0)) {
            return false;
        }
        this.generateBox(bqu, ctd, 0, -4, 0, this.width - 1, 0, this.depth - 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 2, 1, 2, 9, 2, 2, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 2, 1, 12, 9, 2, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 2, 1, 3, 2, 2, 11, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 9, 1, 3, 9, 2, 11, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 1, 3, 1, 10, 6, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 1, 3, 13, 10, 6, 13, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 1, 3, 2, 1, 6, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 10, 3, 2, 10, 6, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 2, 3, 2, 9, 3, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 2, 6, 2, 9, 6, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 3, 7, 3, 8, 7, 11, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 4, 8, 4, 7, 8, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateAirBox(bqu, ctd, 3, 1, 3, 8, 2, 11);
        this.generateAirBox(bqu, ctd, 4, 3, 6, 7, 3, 9);
        this.generateAirBox(bqu, ctd, 2, 4, 2, 9, 5, 12);
        this.generateAirBox(bqu, ctd, 4, 6, 5, 7, 6, 9);
        this.generateAirBox(bqu, ctd, 5, 7, 6, 6, 7, 8);
        this.generateAirBox(bqu, ctd, 5, 1, 2, 6, 2, 2);
        this.generateAirBox(bqu, ctd, 5, 2, 12, 6, 2, 12);
        this.generateAirBox(bqu, ctd, 5, 5, 1, 6, 5, 1);
        this.generateAirBox(bqu, ctd, 5, 5, 13, 6, 5, 13);
        this.placeBlock(bqu, Blocks.AIR.defaultBlockState(), 1, 5, 5, ctd);
        this.placeBlock(bqu, Blocks.AIR.defaultBlockState(), 10, 5, 5, ctd);
        this.placeBlock(bqu, Blocks.AIR.defaultBlockState(), 1, 5, 9, ctd);
        this.placeBlock(bqu, Blocks.AIR.defaultBlockState(), 10, 5, 9, ctd);
        for (int integer9 = 0; integer9 <= 14; integer9 += 14) {
            this.generateBox(bqu, ctd, 2, 4, integer9, 2, 5, integer9, false, random, JunglePyramidPiece.STONE_SELECTOR);
            this.generateBox(bqu, ctd, 4, 4, integer9, 4, 5, integer9, false, random, JunglePyramidPiece.STONE_SELECTOR);
            this.generateBox(bqu, ctd, 7, 4, integer9, 7, 5, integer9, false, random, JunglePyramidPiece.STONE_SELECTOR);
            this.generateBox(bqu, ctd, 9, 4, integer9, 9, 5, integer9, false, random, JunglePyramidPiece.STONE_SELECTOR);
        }
        this.generateBox(bqu, ctd, 5, 6, 0, 6, 6, 0, false, random, JunglePyramidPiece.STONE_SELECTOR);
        for (int integer9 = 0; integer9 <= 11; integer9 += 11) {
            for (int integer10 = 2; integer10 <= 12; integer10 += 2) {
                this.generateBox(bqu, ctd, integer9, 4, integer10, integer9, 5, integer10, false, random, JunglePyramidPiece.STONE_SELECTOR);
            }
            this.generateBox(bqu, ctd, integer9, 6, 5, integer9, 6, 5, false, random, JunglePyramidPiece.STONE_SELECTOR);
            this.generateBox(bqu, ctd, integer9, 6, 9, integer9, 6, 9, false, random, JunglePyramidPiece.STONE_SELECTOR);
        }
        this.generateBox(bqu, ctd, 2, 7, 2, 2, 9, 2, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 9, 7, 2, 9, 9, 2, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 2, 7, 12, 2, 9, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 9, 7, 12, 9, 9, 12, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 4, 9, 4, 4, 9, 4, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 7, 9, 4, 7, 9, 4, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 4, 9, 10, 4, 9, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 7, 9, 10, 7, 9, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 5, 9, 7, 6, 9, 7, false, random, JunglePyramidPiece.STONE_SELECTOR);
        final BlockState cfj9 = ((StateHolder<O, BlockState>)Blocks.COBBLESTONE_STAIRS.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)StairBlock.FACING, Direction.EAST);
        final BlockState cfj10 = ((StateHolder<O, BlockState>)Blocks.COBBLESTONE_STAIRS.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)StairBlock.FACING, Direction.WEST);
        final BlockState cfj11 = ((StateHolder<O, BlockState>)Blocks.COBBLESTONE_STAIRS.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)StairBlock.FACING, Direction.SOUTH);
        final BlockState cfj12 = ((StateHolder<O, BlockState>)Blocks.COBBLESTONE_STAIRS.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)StairBlock.FACING, Direction.NORTH);
        this.placeBlock(bqu, cfj12, 5, 9, 6, ctd);
        this.placeBlock(bqu, cfj12, 6, 9, 6, ctd);
        this.placeBlock(bqu, cfj11, 5, 9, 8, ctd);
        this.placeBlock(bqu, cfj11, 6, 9, 8, ctd);
        this.placeBlock(bqu, cfj12, 4, 0, 0, ctd);
        this.placeBlock(bqu, cfj12, 5, 0, 0, ctd);
        this.placeBlock(bqu, cfj12, 6, 0, 0, ctd);
        this.placeBlock(bqu, cfj12, 7, 0, 0, ctd);
        this.placeBlock(bqu, cfj12, 4, 1, 8, ctd);
        this.placeBlock(bqu, cfj12, 4, 2, 9, ctd);
        this.placeBlock(bqu, cfj12, 4, 3, 10, ctd);
        this.placeBlock(bqu, cfj12, 7, 1, 8, ctd);
        this.placeBlock(bqu, cfj12, 7, 2, 9, ctd);
        this.placeBlock(bqu, cfj12, 7, 3, 10, ctd);
        this.generateBox(bqu, ctd, 4, 1, 9, 4, 1, 9, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 7, 1, 9, 7, 1, 9, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 4, 1, 10, 7, 2, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 5, 4, 5, 6, 4, 5, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.placeBlock(bqu, cfj9, 4, 4, 5, ctd);
        this.placeBlock(bqu, cfj10, 7, 4, 5, ctd);
        for (int integer11 = 0; integer11 < 4; ++integer11) {
            this.placeBlock(bqu, cfj11, 5, 0 - integer11, 6 + integer11, ctd);
            this.placeBlock(bqu, cfj11, 6, 0 - integer11, 6 + integer11, ctd);
            this.generateAirBox(bqu, ctd, 5, 0 - integer11, 7 + integer11, 6, 0 - integer11, 9 + integer11);
        }
        this.generateAirBox(bqu, ctd, 1, -3, 12, 10, -1, 13);
        this.generateAirBox(bqu, ctd, 1, -3, 1, 3, -1, 13);
        this.generateAirBox(bqu, ctd, 1, -3, 1, 9, -1, 5);
        for (int integer11 = 1; integer11 <= 13; integer11 += 2) {
            this.generateBox(bqu, ctd, 1, -3, integer11, 1, -2, integer11, false, random, JunglePyramidPiece.STONE_SELECTOR);
        }
        for (int integer11 = 2; integer11 <= 12; integer11 += 2) {
            this.generateBox(bqu, ctd, 1, -1, integer11, 3, -1, integer11, false, random, JunglePyramidPiece.STONE_SELECTOR);
        }
        this.generateBox(bqu, ctd, 2, -2, 1, 5, -2, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 7, -2, 1, 9, -2, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 6, -3, 1, 6, -3, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 6, -1, 1, 6, -1, 1, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.placeBlock(bqu, (((StateHolder<O, BlockState>)Blocks.TRIPWIRE_HOOK.defaultBlockState()).setValue((Property<Comparable>)TripWireHookBlock.FACING, Direction.EAST)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireHookBlock.ATTACHED, true), 1, -3, 8, ctd);
        this.placeBlock(bqu, (((StateHolder<O, BlockState>)Blocks.TRIPWIRE_HOOK.defaultBlockState()).setValue((Property<Comparable>)TripWireHookBlock.FACING, Direction.WEST)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireHookBlock.ATTACHED, true), 4, -3, 8, ctd);
        this.placeBlock(bqu, ((((StateHolder<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, ctd);
        this.placeBlock(bqu, ((((StateHolder<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, ctd);
        final BlockState cfj13 = (((StateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.NORTH, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.SOUTH, RedstoneSide.SIDE);
        this.placeBlock(bqu, cfj13, 5, -3, 7, ctd);
        this.placeBlock(bqu, cfj13, 5, -3, 6, ctd);
        this.placeBlock(bqu, cfj13, 5, -3, 5, ctd);
        this.placeBlock(bqu, cfj13, 5, -3, 4, ctd);
        this.placeBlock(bqu, cfj13, 5, -3, 3, ctd);
        this.placeBlock(bqu, cfj13, 5, -3, 2, ctd);
        this.placeBlock(bqu, (((StateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.NORTH, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.WEST, RedstoneSide.SIDE), 5, -3, 1, ctd);
        this.placeBlock(bqu, (((StateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.EAST, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.WEST, RedstoneSide.SIDE), 4, -3, 1, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 3, -3, 1, ctd);
        if (!this.placedTrap1) {
            this.placedTrap1 = this.createDispenser(bqu, ctd, random, 3, -2, 1, Direction.NORTH, BuiltInLootTables.JUNGLE_TEMPLE_DISPENSER);
        }
        this.placeBlock(bqu, ((StateHolder<O, BlockState>)Blocks.VINE.defaultBlockState()).<Comparable, Boolean>setValue((Property<Comparable>)VineBlock.SOUTH, true), 3, -2, 2, ctd);
        this.placeBlock(bqu, (((StateHolder<O, BlockState>)Blocks.TRIPWIRE_HOOK.defaultBlockState()).setValue((Property<Comparable>)TripWireHookBlock.FACING, Direction.NORTH)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireHookBlock.ATTACHED, true), 7, -3, 1, ctd);
        this.placeBlock(bqu, (((StateHolder<O, BlockState>)Blocks.TRIPWIRE_HOOK.defaultBlockState()).setValue((Property<Comparable>)TripWireHookBlock.FACING, Direction.SOUTH)).<Comparable, Boolean>setValue((Property<Comparable>)TripWireHookBlock.ATTACHED, true), 7, -3, 5, ctd);
        this.placeBlock(bqu, ((((StateHolder<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, ctd);
        this.placeBlock(bqu, ((((StateHolder<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, ctd);
        this.placeBlock(bqu, ((((StateHolder<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, ctd);
        this.placeBlock(bqu, (((StateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.EAST, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.WEST, RedstoneSide.SIDE), 8, -3, 6, ctd);
        this.placeBlock(bqu, (((StateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.WEST, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.SOUTH, RedstoneSide.SIDE), 9, -3, 6, ctd);
        this.placeBlock(bqu, (((StateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.NORTH, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.SOUTH, RedstoneSide.UP), 9, -3, 5, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 9, -3, 4, ctd);
        this.placeBlock(bqu, cfj13, 9, -2, 4, ctd);
        if (!this.placedTrap2) {
            this.placedTrap2 = this.createDispenser(bqu, ctd, random, 9, -2, 3, Direction.WEST, BuiltInLootTables.JUNGLE_TEMPLE_DISPENSER);
        }
        this.placeBlock(bqu, ((StateHolder<O, BlockState>)Blocks.VINE.defaultBlockState()).<Comparable, Boolean>setValue((Property<Comparable>)VineBlock.EAST, true), 8, -1, 3, ctd);
        this.placeBlock(bqu, ((StateHolder<O, BlockState>)Blocks.VINE.defaultBlockState()).<Comparable, Boolean>setValue((Property<Comparable>)VineBlock.EAST, true), 8, -2, 3, ctd);
        if (!this.placedMainChest) {
            this.placedMainChest = this.createChest(bqu, ctd, random, 8, -3, 3, BuiltInLootTables.JUNGLE_TEMPLE);
        }
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 9, -3, 2, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 8, -3, 1, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 4, -3, 5, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 5, -2, 5, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 5, -1, 5, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 6, -3, 5, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 7, -2, 5, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 7, -1, 5, ctd);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 8, -3, 5, ctd);
        this.generateBox(bqu, ctd, 9, -1, 1, 9, -1, 5, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateAirBox(bqu, ctd, 8, -3, 8, 10, -1, 10);
        this.placeBlock(bqu, Blocks.CHISELED_STONE_BRICKS.defaultBlockState(), 8, -2, 11, ctd);
        this.placeBlock(bqu, Blocks.CHISELED_STONE_BRICKS.defaultBlockState(), 9, -2, 11, ctd);
        this.placeBlock(bqu, Blocks.CHISELED_STONE_BRICKS.defaultBlockState(), 10, -2, 11, ctd);
        final BlockState cfj14 = (((StateHolder<O, BlockState>)Blocks.LEVER.defaultBlockState()).setValue((Property<Comparable>)LeverBlock.FACING, Direction.NORTH)).<AttachFace, AttachFace>setValue(LeverBlock.FACE, AttachFace.WALL);
        this.placeBlock(bqu, cfj14, 8, -2, 12, ctd);
        this.placeBlock(bqu, cfj14, 9, -2, 12, ctd);
        this.placeBlock(bqu, cfj14, 10, -2, 12, ctd);
        this.generateBox(bqu, ctd, 8, -3, 8, 8, -3, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.generateBox(bqu, ctd, 10, -3, 8, 10, -3, 10, false, random, JunglePyramidPiece.STONE_SELECTOR);
        this.placeBlock(bqu, Blocks.MOSSY_COBBLESTONE.defaultBlockState(), 10, -2, 9, ctd);
        this.placeBlock(bqu, cfj13, 8, -2, 9, ctd);
        this.placeBlock(bqu, cfj13, 8, -2, 10, ctd);
        this.placeBlock(bqu, (((((StateHolder<O, BlockState>)Blocks.REDSTONE_WIRE.defaultBlockState()).setValue(RedStoneWireBlock.NORTH, RedstoneSide.SIDE)).setValue(RedStoneWireBlock.SOUTH, RedstoneSide.SIDE)).setValue(RedStoneWireBlock.EAST, RedstoneSide.SIDE)).<RedstoneSide, RedstoneSide>setValue(RedStoneWireBlock.WEST, RedstoneSide.SIDE), 10, -1, 9, ctd);
        this.placeBlock(bqu, ((StateHolder<O, BlockState>)Blocks.STICKY_PISTON.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)PistonBaseBlock.FACING, Direction.UP), 9, -2, 8, ctd);
        this.placeBlock(bqu, ((StateHolder<O, BlockState>)Blocks.STICKY_PISTON.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)PistonBaseBlock.FACING, Direction.WEST), 10, -2, 8, ctd);
        this.placeBlock(bqu, ((StateHolder<O, BlockState>)Blocks.STICKY_PISTON.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)PistonBaseBlock.FACING, Direction.WEST), 10, -1, 8, ctd);
        this.placeBlock(bqu, ((StateHolder<O, BlockState>)Blocks.REPEATER.defaultBlockState()).<Comparable, Direction>setValue((Property<Comparable>)RepeaterBlock.FACING, Direction.NORTH), 10, -2, 10, ctd);
        if (!this.placedHiddenChest) {
            this.placedHiddenChest = this.createChest(bqu, ctd, 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();
            }
        }
    }
}
