package jp.plusplus.fbs.world.structure; import jp.plusplus.fbs.Registry; import jp.plusplus.fbs.block.BlockCore; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.world.World; import net.minecraft.world.gen.structure.StructureBoundingBox; import net.minecraft.world.gen.structure.StructureComponent; import java.util.Random; /** * Createdby pluslus_Fon 2015/06/06. * 1つの図書館からだいたい16.8冊手に入る? */ public class StructureSealedLib1 extends StructureComponent { private boolean chest=false; public StructureSealedLib1(){} public StructureSealedLib1(int par1, Random rand, int x, int y, int z) { this.coordBaseMode = 0; //y=6+rand.nextInt(40-6+1); this.boundingBox = new StructureBoundingBox(x, y, z, x + 11, y+6, z + 11); } @Override protected void func_143012_a(NBTTagCompound tag) { tag.setBoolean("Chest", this.chest); } @Override protected void func_143011_b(NBTTagCompound tag) { chest = tag.getBoolean("Chest"); } @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { int[] bx={1,1,2,3, 7,8,9,9, 9,9,8,7, 3,2,1,1}; int[] bz={3,2,1,1, 1,1,2,3, 7,8,9,9, 9,9,8,7}; int[] wx={1,9,9,1}; int[] wz={1,1,9,9}; int[] tx={1,5,9,5}; int[] tz={5,1,5,9}; this.fillWithBlocks(world, box, 0, 0, 0, 10, 5, 10, BlockCore.plank, BlockCore.plank, false); this.fillWithBlocks(world, box, 1, 1, 1, 9, 4, 9, Blocks.air, Blocks.air, false); for(int i=0;i0) this.placeBlockAtCurrentPosition(world, BlockCore.plank, 0, 4+i, 1+k, 4+n, box); } else this.placeBlockAtCurrentPosition(world, BlockCore.bookshelf, getNum(rand, 4), 4+i, 1+k, 4+n, box); } } } /* for(int k=0;k<4;k++){ this.placeBlockAtCurrentPosition(world, BlockCore.plank, 0, 5, 1+k, 5, box); } */ for(int i=0;i