tcr/server/src/main/java/server/worldgen/structure/StructureScattered.java
2025-06-21 19:59:52 +02:00

691 lines
54 KiB
Java
Executable file

package server.worldgen.structure;
import common.block.artificial.BlockFlowerPot;
import common.block.foliage.BlockFlower;
import common.block.natural.BlockSandStone;
import common.block.tech.BlockLever;
import common.block.tech.BlockTripWire;
import common.block.tech.BlockTripWireHook;
import common.color.DyeColor;
import common.entity.npc.EntityMage;
import common.init.Blocks;
import common.init.Items;
import common.item.RngLoot;
import common.rng.Random;
import common.tags.TagObject;
import common.util.BlockPos;
import common.util.Facing;
import server.vars.SVars;
import server.world.WorldServer;
import server.worldgen.LootConstants;
public class StructureScattered
{
public static void registerScatteredFeaturePieces()
{
MapGenStructureIO.registerStructureComponent(StructureScattered.DesertPyramid.class, "TeDP");
MapGenStructureIO.registerStructureComponent(StructureScattered.JunglePyramid.class, "TeJP");
MapGenStructureIO.registerStructureComponent(StructureScattered.SwampHut.class, "TeSH");
}
public static class DesertPyramid extends StructureScattered.Feature
{
private boolean[] hasPlacedChest = new boolean[4];
public DesertPyramid()
{
}
public DesertPyramid(Random p_i2062_1_, int p_i2062_2_, int p_i2062_3_)
{
super(p_i2062_1_, p_i2062_2_, 64, p_i2062_3_, 21, 15, 21);
}
protected void writeTags(TagObject tagCompound)
{
super.writeTags(tagCompound);
tagCompound.setBool("hasPlacedChest0", this.hasPlacedChest[0]);
tagCompound.setBool("hasPlacedChest1", this.hasPlacedChest[1]);
tagCompound.setBool("hasPlacedChest2", this.hasPlacedChest[2]);
tagCompound.setBool("hasPlacedChest3", this.hasPlacedChest[3]);
}
protected void readTags(TagObject tagCompound)
{
super.readTags(tagCompound);
this.hasPlacedChest[0] = tagCompound.getBool("hasPlacedChest0");
this.hasPlacedChest[1] = tagCompound.getBool("hasPlacedChest1");
this.hasPlacedChest[2] = tagCompound.getBool("hasPlacedChest2");
this.hasPlacedChest[3] = tagCompound.getBool("hasPlacedChest3");
}
public boolean addComponentParts(WorldServer worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
for (int i = 1; i <= 9; ++i)
{
this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, i, i, this.scatteredFeatureSizeX - 1 - i, i, this.scatteredFeatureSizeZ - 1 - i, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, i + 1, i, i + 1, this.scatteredFeatureSizeX - 2 - i, i, this.scatteredFeatureSizeZ - 2 - i, Blocks.air.getState(), Blocks.air.getState(), false);
}
for (int j2 = 0; j2 < this.scatteredFeatureSizeX; ++j2)
{
for (int j = 0; j < this.scatteredFeatureSizeZ; ++j)
{
int k = -5;
this.replaceAirAndLiquidDownwards(worldIn, Blocks.sandstone.getState(), j2, k, j, structureBoundingBoxIn);
}
}
int k2 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 3);
int l2 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 2);
int i3 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 0);
int l = this.getMetadataWithOffset(Blocks.sandstone_stairs, 1);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 9, 4, Blocks.sandstone.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 10, 1, 3, 10, 3, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), 2, 10, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l2), 2, 10, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(i3), 0, 10, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l), 4, 10, 2, structureBoundingBoxIn);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 5, 0, 0, this.scatteredFeatureSizeX - 1, 9, 4, Blocks.sandstone.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 4, 10, 1, this.scatteredFeatureSizeX - 2, 10, 3, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), this.scatteredFeatureSizeX - 3, 10, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l2), this.scatteredFeatureSizeX - 3, 10, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(i3), this.scatteredFeatureSizeX - 5, 10, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l), this.scatteredFeatureSizeX - 1, 10, 2, structureBoundingBoxIn);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 0, 0, 12, 4, 4, Blocks.sandstone.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, 0, 11, 3, 4, Blocks.air.getState(), Blocks.air.getState(), false);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 9, 1, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 9, 2, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 9, 3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 10, 3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 11, 3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 11, 2, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 11, 1, 1, structureBoundingBoxIn);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 8, 3, 3, Blocks.sandstone.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 2, 8, 2, 2, Blocks.air.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 1, 16, 3, 3, Blocks.sandstone.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 2, 16, 2, 2, Blocks.air.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 4, 5, this.scatteredFeatureSizeX - 6, 4, this.scatteredFeatureSizeZ - 6, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 4, 9, 11, 4, 11, Blocks.air.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 1, 8, 8, 3, 8, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 8, 12, 3, 8, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 1, 12, 8, 3, 12, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 12, 12, 3, 12, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 5, 4, 4, 11, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 5, 1, 5, this.scatteredFeatureSizeX - 2, 4, 11, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 7, 9, 6, 7, 11, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 7, 7, 9, this.scatteredFeatureSizeX - 7, 7, 11, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 9, 5, 7, 11, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 6, 5, 9, this.scatteredFeatureSizeX - 6, 7, 11, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false);
this.setBlockState(worldIn, Blocks.air.getState(), 5, 5, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 5, 6, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 6, 6, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), this.scatteredFeatureSizeX - 6, 5, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), this.scatteredFeatureSizeX - 6, 6, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), this.scatteredFeatureSizeX - 7, 6, 10, structureBoundingBoxIn);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 4, 4, 2, 6, 4, Blocks.air.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 3, 4, 4, this.scatteredFeatureSizeX - 3, 6, 4, Blocks.air.getState(), Blocks.air.getState(), false);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), 2, 4, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), 2, 3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), this.scatteredFeatureSizeX - 3, 4, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), this.scatteredFeatureSizeX - 3, 3, 4, structureBoundingBoxIn);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 3, 2, 2, 3, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 3, 1, 3, this.scatteredFeatureSizeX - 2, 2, 3, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getState(), 1, 1, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getState(), this.scatteredFeatureSizeX - 2, 1, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_slab.getState(), 1, 2, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_slab.getState(), this.scatteredFeatureSizeX - 2, 2, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l), 2, 1, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(i3), this.scatteredFeatureSizeX - 3, 1, 2, structureBoundingBoxIn);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 5, 4, 3, 18, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 5, 3, 5, this.scatteredFeatureSizeX - 5, 3, 17, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 5, 4, 2, 16, Blocks.air.getState(), Blocks.air.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 6, 1, 5, this.scatteredFeatureSizeX - 5, 2, 16, Blocks.air.getState(), Blocks.air.getState(), false);
for (int k1 = 5; k1 <= 17; k1 += 2)
{
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 4, 1, k1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 4, 2, k1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), this.scatteredFeatureSizeX - 5, 1, k1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), this.scatteredFeatureSizeX - 5, 2, k1, structureBoundingBoxIn);
}
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 10, 0, 7, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 10, 0, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 9, 0, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 11, 0, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 8, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 12, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 7, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 13, 0, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 9, 0, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 11, 0, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 10, 0, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 10, 0, 13, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.blue_clay.getState(), 10, 0, 10, structureBoundingBoxIn);
for (int j3 = 0; j3 <= this.scatteredFeatureSizeX - 1; j3 += this.scatteredFeatureSizeX - 1)
{
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 2, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 2, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 2, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 3, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 3, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 4, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), j3, 4, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 4, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 5, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 5, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 5, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 6, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), j3, 6, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 6, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 7, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 7, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 7, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 8, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 8, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 8, 3, structureBoundingBoxIn);
}
for (int k3 = 2; k3 <= this.scatteredFeatureSizeX - 3; k3 += this.scatteredFeatureSizeX - 3 - 2)
{
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 - 1, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 + 1, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 - 1, 3, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 3, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 + 1, 3, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 - 1, 4, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), k3, 4, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 + 1, 4, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 - 1, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 + 1, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 - 1, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), k3, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 + 1, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 - 1, 7, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 7, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 + 1, 7, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 - 1, 8, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3, 8, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 + 1, 8, 0, structureBoundingBoxIn);
}
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 4, 0, 12, 6, 0, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false);
this.setBlockState(worldIn, Blocks.air.getState(), 8, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 12, 6, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 9, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 10, 5, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.orange_clay.getState(), 11, 5, 0, structureBoundingBoxIn);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -14, 8, 12, -11, 12, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -10, 8, 12, -10, 12, Blocks.carved_sandstone.getState(), Blocks.carved_sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -9, 8, 12, -9, 12, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -8, 8, 12, -1, 12, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, -11, 9, 11, -1, 11, Blocks.air.getState(), Blocks.air.getState(), false);
this.setBlockState(worldIn, Blocks.stone_pressure_plate.getState(), 10, -11, 10, structureBoundingBoxIn);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, -13, 9, 11, -13, 11, Blocks.tnt.getState(), Blocks.air.getState(), false);
this.setBlockState(worldIn, Blocks.air.getState(), 8, -11, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 8, -10, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 7, -10, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 7, -11, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 12, -11, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 12, -10, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 13, -10, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 13, -11, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 10, -11, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 10, -10, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 10, -10, 7, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 10, -11, 7, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 10, -11, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 10, -10, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 10, -10, 13, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 10, -11, 13, structureBoundingBoxIn);
for (Facing enumfacing : Facing.Plane.HORIZONTAL)
{
if (!this.hasPlacedChest[enumfacing.getHorizontalIndex()])
{
int l1 = enumfacing.getFrontOffsetX() * 2;
int i2 = enumfacing.getFrontOffsetZ() * 2;
this.hasPlacedChest[enumfacing.getHorizontalIndex()] = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 10 + l1, -11, 10 + i2, RngLoot.addToList(LootConstants.DESERT_PYRAMID, Items.enchanted_book.getRandom(randomIn)), 2 + randomIn.zrange(5));
}
}
return true;
}
}
abstract static class Feature extends StructureComponent
{
protected int scatteredFeatureSizeX;
protected int scatteredFeatureSizeY;
protected int scatteredFeatureSizeZ;
protected int field_74936_d = -1;
public Feature()
{
}
protected Feature(Random p_i2065_1_, int p_i2065_2_, int p_i2065_3_, int p_i2065_4_, int p_i2065_5_, int p_i2065_6_, int p_i2065_7_)
{
super(0);
this.scatteredFeatureSizeX = p_i2065_5_;
this.scatteredFeatureSizeY = p_i2065_6_;
this.scatteredFeatureSizeZ = p_i2065_7_;
this.coordBaseMode = Facing.Plane.HORIZONTAL.random(p_i2065_1_);
switch (this.coordBaseMode)
{
case NORTH:
case SOUTH:
this.boundingBox = new StructureBoundingBox(p_i2065_2_, p_i2065_3_, p_i2065_4_, p_i2065_2_ + p_i2065_5_ - 1, p_i2065_3_ + p_i2065_6_ - 1, p_i2065_4_ + p_i2065_7_ - 1);
break;
default:
this.boundingBox = new StructureBoundingBox(p_i2065_2_, p_i2065_3_, p_i2065_4_, p_i2065_2_ + p_i2065_7_ - 1, p_i2065_3_ + p_i2065_6_ - 1, p_i2065_4_ + p_i2065_5_ - 1);
}
}
protected void writeTags(TagObject tagCompound)
{
tagCompound.setInt("Width", this.scatteredFeatureSizeX);
tagCompound.setInt("Height", this.scatteredFeatureSizeY);
tagCompound.setInt("Depth", this.scatteredFeatureSizeZ);
tagCompound.setInt("HPos", this.field_74936_d);
}
protected void readTags(TagObject tagCompound)
{
this.scatteredFeatureSizeX = tagCompound.getInt("Width");
this.scatteredFeatureSizeY = tagCompound.getInt("Height");
this.scatteredFeatureSizeZ = tagCompound.getInt("Depth");
this.field_74936_d = tagCompound.getInt("HPos");
}
protected boolean func_74935_a(WorldServer worldIn, StructureBoundingBox p_74935_2_, int p_74935_3_)
{
if (this.field_74936_d >= 0)
{
return true;
}
else
{
int i = 0;
int j = 0;
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
for (int k = this.boundingBox.minZ; k <= this.boundingBox.maxZ; ++k)
{
for (int l = this.boundingBox.minX; l <= this.boundingBox.maxX; ++l)
{
blockpos$mutableblockpos.set(l, 64, k);
if (p_74935_2_.isVecInside(blockpos$mutableblockpos))
{
i += Math.max(worldIn.getTopSolidOrLiquidBlock(blockpos$mutableblockpos).getY(), worldIn.getSeaLevel());
++j;
}
}
}
if (j == 0)
{
return false;
}
else
{
this.field_74936_d = i / j;
this.boundingBox.offset(0, this.field_74936_d - this.boundingBox.minY + p_74935_3_, 0);
return true;
}
}
}
}
public static class JunglePyramid extends StructureScattered.Feature
{
private boolean placedMainChest;
private boolean placedHiddenChest;
private boolean placedTrap1;
private boolean placedTrap2;
private static StructureScattered.JunglePyramid.Stones junglePyramidsRandomScatteredStones = new StructureScattered.JunglePyramid.Stones();
public JunglePyramid()
{
}
public JunglePyramid(Random p_i2064_1_, int p_i2064_2_, int p_i2064_3_)
{
super(p_i2064_1_, p_i2064_2_, 64, p_i2064_3_, 12, 10, 15);
}
protected void writeTags(TagObject tagCompound)
{
super.writeTags(tagCompound);
tagCompound.setBool("placedMainChest", this.placedMainChest);
tagCompound.setBool("placedHiddenChest", this.placedHiddenChest);
tagCompound.setBool("placedTrap1", this.placedTrap1);
tagCompound.setBool("placedTrap2", this.placedTrap2);
}
protected void readTags(TagObject tagCompound)
{
super.readTags(tagCompound);
this.placedMainChest = tagCompound.getBool("placedMainChest");
this.placedHiddenChest = tagCompound.getBool("placedHiddenChest");
this.placedTrap1 = tagCompound.getBool("placedTrap1");
this.placedTrap2 = tagCompound.getBool("placedTrap2");
}
public boolean addComponentParts(WorldServer worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
if (!this.func_74935_a(worldIn, structureBoundingBoxIn, 0))
{
return false;
}
else
{
int i = this.getMetadataWithOffset(Blocks.cobblestone_stairs, 3);
int j = this.getMetadataWithOffset(Blocks.cobblestone_stairs, 2);
int k = this.getMetadataWithOffset(Blocks.cobblestone_stairs, 0);
int l = this.getMetadataWithOffset(Blocks.cobblestone_stairs, 1);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 2, 9, 2, 2, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 12, 9, 2, 12, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 3, 2, 2, 11, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 1, 3, 9, 2, 11, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 1, 10, 6, 1, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 13, 10, 6, 13, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 2, 1, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, 3, 2, 10, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 3, 2, 9, 3, 12, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 6, 2, 9, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 3, 7, 3, 8, 7, 11, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 8, 4, 7, 8, 10, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithAir(worldIn, structureBoundingBoxIn, 3, 1, 3, 8, 2, 11);
this.fillWithAir(worldIn, structureBoundingBoxIn, 4, 3, 6, 7, 3, 9);
this.fillWithAir(worldIn, structureBoundingBoxIn, 2, 4, 2, 9, 5, 12);
this.fillWithAir(worldIn, structureBoundingBoxIn, 4, 6, 5, 7, 6, 9);
this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 7, 6, 6, 7, 8);
this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 1, 2, 6, 2, 2);
this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 2, 12, 6, 2, 12);
this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 5, 1, 6, 5, 1);
this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 5, 13, 6, 5, 13);
this.setBlockState(worldIn, Blocks.air.getState(), 1, 5, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 10, 5, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 1, 5, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 10, 5, 9, structureBoundingBoxIn);
for (int i1 = 0; i1 <= 14; i1 += 14)
{
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 4, i1, 2, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 4, i1, 4, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 4, i1, 7, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 4, i1, 9, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones);
}
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 6, 0, 6, 6, 0, false, randomIn, junglePyramidsRandomScatteredStones);
for (int k1 = 0; k1 <= 11; k1 += 11)
{
for (int j1 = 2; j1 <= 12; j1 += 2)
{
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 4, j1, k1, 5, j1, false, randomIn, junglePyramidsRandomScatteredStones);
}
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 5, k1, 6, 5, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 9, k1, 6, 9, false, randomIn, junglePyramidsRandomScatteredStones);
}
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 2, 2, 9, 2, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 2, 9, 9, 2, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 12, 2, 9, 12, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 12, 9, 9, 12, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 4, 4, 9, 4, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 4, 7, 9, 4, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 10, 4, 9, 10, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 10, 7, 9, 10, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 9, 7, 6, 9, 7, false, randomIn, junglePyramidsRandomScatteredStones);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 5, 9, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 6, 9, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(j), 5, 9, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(j), 6, 9, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 4, 0, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 5, 0, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 6, 0, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 7, 0, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 4, 1, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 4, 2, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 4, 3, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 7, 1, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 7, 2, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(i), 7, 3, 10, structureBoundingBoxIn);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 4, 1, 9, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 1, 9, 7, 1, 9, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 10, 7, 2, 10, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 4, 5, 6, 4, 5, false, randomIn, junglePyramidsRandomScatteredStones);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(k), 4, 4, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(l), 7, 4, 5, structureBoundingBoxIn);
for (int l1 = 0; l1 < 4; ++l1)
{
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(j), 5, 0 - l1, 6 + l1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(j), 6, 0 - l1, 6 + l1, structureBoundingBoxIn);
this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 0 - l1, 7 + l1, 6, 0 - l1, 9 + l1);
}
this.fillWithAir(worldIn, structureBoundingBoxIn, 1, -3, 12, 10, -1, 13);
this.fillWithAir(worldIn, structureBoundingBoxIn, 1, -3, 1, 3, -1, 13);
this.fillWithAir(worldIn, structureBoundingBoxIn, 1, -3, 1, 9, -1, 5);
for (int i2 = 1; i2 <= 13; i2 += 2)
{
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -3, i2, 1, -2, i2, false, randomIn, junglePyramidsRandomScatteredStones);
}
for (int j2 = 2; j2 <= 12; j2 += 2)
{
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -1, j2, 3, -1, j2, false, randomIn, junglePyramidsRandomScatteredStones);
}
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, -2, 1, 5, -2, 1, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, -2, 1, 9, -2, 1, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -3, 1, 6, -3, 1, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -1, 1, 6, -1, 1, false, randomIn, junglePyramidsRandomScatteredStones);
this.setBlockState(worldIn, Blocks.tripwire_hook.getStateFromMeta(this.getMetadataWithOffset(Blocks.tripwire_hook, Facing.EAST.getHorizontalIndex())).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), 1, -3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.tripwire_hook.getStateFromMeta(this.getMetadataWithOffset(Blocks.tripwire_hook, Facing.WEST.getHorizontalIndex())).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), 4, -3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 2, -3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 3, -3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 7, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 4, -3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 3, -3, 1, structureBoundingBoxIn);
if (!this.placedTrap1)
{
this.placedTrap1 = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 3, -2, 1, Facing.NORTH.getIndex(), LootConstants.JUNGLE_TRAP, 2);
}
this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 3, -2, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.tripwire_hook.getStateFromMeta(this.getMetadataWithOffset(Blocks.tripwire_hook, Facing.NORTH.getHorizontalIndex())).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), 7, -3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.tripwire_hook.getStateFromMeta(this.getMetadataWithOffset(Blocks.tripwire_hook, Facing.SOUTH.getHorizontalIndex())).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), 7, -3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 8, -3, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 9, -3, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 9, -3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 9, -3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 9, -2, 4, structureBoundingBoxIn);
if (!this.placedTrap2)
{
this.placedTrap2 = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 9, -2, 3, Facing.WEST.getIndex(), LootConstants.JUNGLE_TRAP, 2);
}
this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 8, -1, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 8, -2, 3, structureBoundingBoxIn);
if (!this.placedMainChest)
{
this.placedMainChest = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 8, -3, 3, RngLoot.addToList(LootConstants.JUNGLE_MAIN, Items.enchanted_book.getRandom(randomIn)), 2 + randomIn.zrange(5));
}
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 9, -3, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 8, -3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 4, -3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 5, -2, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 5, -1, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 6, -3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 7, -2, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 7, -1, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 8, -3, 5, structureBoundingBoxIn);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, -1, 1, 9, -1, 5, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithAir(worldIn, structureBoundingBoxIn, 8, -3, 8, 10, -1, 10);
this.setBlockState(worldIn, Blocks.carved_stonebrick.getState(), 8, -2, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_stonebrick.getState(), 9, -2, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_stonebrick.getState(), 10, -2, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.lever.getStateFromMeta(BlockLever.getMetadataForFacing(Facing.getFront(this.getMetadataWithOffset(Blocks.lever, Facing.NORTH.getIndex())))), 8, -2, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.lever.getStateFromMeta(BlockLever.getMetadataForFacing(Facing.getFront(this.getMetadataWithOffset(Blocks.lever, Facing.NORTH.getIndex())))), 9, -2, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.lever.getStateFromMeta(BlockLever.getMetadataForFacing(Facing.getFront(this.getMetadataWithOffset(Blocks.lever, Facing.NORTH.getIndex())))), 10, -2, 12, structureBoundingBoxIn);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, -3, 8, 8, -3, 10, false, randomIn, junglePyramidsRandomScatteredStones);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, -3, 8, 10, -3, 10, false, randomIn, junglePyramidsRandomScatteredStones);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 10, -2, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 8, -2, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 8, -2, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 10, -1, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sticky_piston.getStateFromMeta(Facing.UP.getIndex()), 9, -2, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sticky_piston.getStateFromMeta(this.getMetadataWithOffset(Blocks.sticky_piston, Facing.WEST.getIndex())), 10, -2, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sticky_piston.getStateFromMeta(this.getMetadataWithOffset(Blocks.sticky_piston, Facing.WEST.getIndex())), 10, -1, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.repeater.getStateFromMeta(this.getMetadataWithOffset(Blocks.repeater, Facing.NORTH.getHorizontalIndex())), 10, -2, 10, structureBoundingBoxIn);
if (!this.placedHiddenChest)
{
this.placedHiddenChest = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 9, -3, 10, RngLoot.addToList(LootConstants.JUNGLE_MAIN, Items.enchanted_book.getRandom(randomIn)), 2 + randomIn.zrange(5));
}
return true;
}
}
static class Stones extends StructureComponent.BlockSelector
{
private Stones()
{
}
public void selectBlocks(Random rand, int x, int y, int z, boolean p_75062_5_)
{
if (rand.floatv() < 0.4F)
{
this.blockstate = Blocks.cobblestone.getState();
}
else
{
this.blockstate = Blocks.mossy_cobblestone.getState();
}
}
}
}
public static class SwampHut extends StructureScattered.Feature
{
private boolean hasMage;
public SwampHut()
{
}
public SwampHut(Random p_i2066_1_, int p_i2066_2_, int p_i2066_3_)
{
super(p_i2066_1_, p_i2066_2_, 64, p_i2066_3_, 7, 7, 9);
}
protected void writeTags(TagObject tagCompound)
{
super.writeTags(tagCompound);
tagCompound.setBool("Mage", this.hasMage);
}
protected void readTags(TagObject tagCompound)
{
super.readTags(tagCompound);
this.hasMage = tagCompound.getBool("Mage");
}
public boolean addComponentParts(WorldServer worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
if (!this.func_74935_a(worldIn, structureBoundingBoxIn, 0))
{
return false;
}
else
{
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 5, 1, 7, Blocks.spruce_planks.getState(), Blocks.spruce_planks.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 2, 5, 4, 7, Blocks.spruce_planks.getState(), Blocks.spruce_planks.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 0, 4, 1, 0, Blocks.spruce_planks.getState(), Blocks.spruce_planks.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 2, 2, 3, 3, 2, Blocks.spruce_planks.getState(), Blocks.spruce_planks.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 3, 1, 3, 6, Blocks.spruce_planks.getState(), Blocks.spruce_planks.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 3, 5, 3, 6, Blocks.spruce_planks.getState(), Blocks.spruce_planks.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 2, 7, 4, 3, 7, Blocks.spruce_planks.getState(), Blocks.spruce_planks.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 2, 1, 3, 2, Blocks.oak_log.getState(), Blocks.oak_log.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 0, 2, 5, 3, 2, Blocks.oak_log.getState(), Blocks.oak_log.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 7, 1, 3, 7, Blocks.oak_log.getState(), Blocks.oak_log.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 0, 7, 5, 3, 7, Blocks.oak_log.getState(), Blocks.oak_log.getState(), false);
this.setBlockState(worldIn, Blocks.oak_fence.getState(), 2, 3, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.oak_fence.getState(), 3, 3, 7, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 1, 3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 5, 3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 5, 3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.flowerpot_black_lotus.getState(), 1, 3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.workbench.getState(), 3, 2, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.cauldron.getState(), 4, 2, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.oak_fence.getState(), 1, 2, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.oak_fence.getState(), 5, 2, 1, structureBoundingBoxIn);
int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3);
int j = this.getMetadataWithOffset(Blocks.oak_stairs, 1);
int k = this.getMetadataWithOffset(Blocks.oak_stairs, 0);
int l = this.getMetadataWithOffset(Blocks.oak_stairs, 2);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 1, 6, 4, 1, Blocks.spruce_stairs.getStateFromMeta(i), Blocks.spruce_stairs.getStateFromMeta(i), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 2, 0, 4, 7, Blocks.spruce_stairs.getStateFromMeta(k), Blocks.spruce_stairs.getStateFromMeta(k), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 4, 2, 6, 4, 7, Blocks.spruce_stairs.getStateFromMeta(j), Blocks.spruce_stairs.getStateFromMeta(j), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 8, 6, 4, 8, Blocks.spruce_stairs.getStateFromMeta(l), Blocks.spruce_stairs.getStateFromMeta(l), false);
for (int i1 = 2; i1 <= 7; i1 += 5)
{
for (int j1 = 1; j1 <= 5; j1 += 4)
{
this.replaceAirAndLiquidDownwards(worldIn, Blocks.oak_log.getState(), j1, -1, i1, structureBoundingBoxIn);
}
}
if (!this.hasMage && SVars.mobs && SVars.spawnHutMage)
{
int l1 = this.getXWithOffset(2, 5);
int i2 = this.getYWithOffset(2);
int k1 = this.getZWithOffset(2, 5);
if (structureBoundingBoxIn.isVecInside(new BlockPos(l1, i2, k1)))
{
this.hasMage = true;
EntityMage mage = new EntityMage(worldIn);
mage.setLocationAndAngles((double)l1 + 0.5D, (double)i2, (double)k1 + 0.5D, 0.0F, 0.0F);
mage.onInitialSpawn(null);
worldIn.spawnEntityInWorld(mage);
}
}
return true;
}
}
}
}