From 05c78126859231a68e199dc34613689bd0978e2f Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Mon, 11 Apr 2016 19:44:54 +0300 Subject: Initial commit --- .../metallurgy/BigMachineFrameTileEntity.java | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 ihl/processing/metallurgy/BigMachineFrameTileEntity.java (limited to 'ihl/processing/metallurgy/BigMachineFrameTileEntity.java') diff --git a/ihl/processing/metallurgy/BigMachineFrameTileEntity.java b/ihl/processing/metallurgy/BigMachineFrameTileEntity.java new file mode 100644 index 0000000..0922355 --- /dev/null +++ b/ihl/processing/metallurgy/BigMachineFrameTileEntity.java @@ -0,0 +1,109 @@ +package ihl.processing.metallurgy; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import ihl.interfaces.IWorkspaceElement; +import ihl.utils.IHLUtils; + +public class BigMachineFrameTileEntity extends TileEntity implements IWorkspaceElement { + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) + { + return false; + } + + @Override + public short getFacing() + { + return 0; + } + + @Override + public void setFacing(short facing) {} + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + return true; + } + + @Override + public float getWrenchDropRate() + { + return 1.0f; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return IHLUtils.getThisModItemStack("frameSteel"); + } + + @Override + public boolean canBeUsed() + { + int ix,iy,iz; + int x = xCoord; + int y = yCoord; + int z = zCoord; + int x0 = xCoord; + int y0 = yCoord; + int z0 = zCoord; + for(ix=x;ix>x-3;ix--) + { + for(iy=y;iy>y-3;iy--) + { + for(iz=z;iz>z-3;iz--) + { + TileEntity te = worldObj.getTileEntity(ix, iy, iz); + if(te instanceof BigMachineFrameTileEntity) + { + x0=ix+1; + y0=iy+1; + z0=iz+1; + } + } + } + } + for(ix=x0-1;ix