From 0427ab89f1753a44b30cbc35ce021cbbdc845109 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Thu, 10 Aug 2017 18:52:45 +0300 Subject: fix missing source folder --- .../metallurgy/LathePart1TileEntity.java | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 src/main/java/ihl/processing/metallurgy/LathePart1TileEntity.java (limited to 'src/main/java/ihl/processing/metallurgy/LathePart1TileEntity.java') diff --git a/src/main/java/ihl/processing/metallurgy/LathePart1TileEntity.java b/src/main/java/ihl/processing/metallurgy/LathePart1TileEntity.java new file mode 100644 index 0000000..788bfd4 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/LathePart1TileEntity.java @@ -0,0 +1,99 @@ +package ihl.processing.metallurgy; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ihl.interfaces.IWorkspaceElement; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class LathePart1TileEntity extends BasicElectricMotorTileEntity implements IWorkspaceElement{ + + public boolean ready=false; + + public LathePart1TileEntity() + { + super(); + } + + + @Override + public String getInventoryName() { + return "Lathe"; + } + + @Override + public void operate() + { + ready=true; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("lathePart1"); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new LatheGui(new LatheContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new LatheContainer(player, this); + } + + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public List[] getInput() + { + return null; + } + + @Override + public boolean canOperate() + { + TileEntity te = worldObj.getTileEntity(xCoord+ForgeDirection.getOrientation(getFacing()).offsetX,yCoord,zCoord+ForgeDirection.getOrientation(getFacing()).offsetZ); + if(te!=null && te instanceof LathePart2TileEntity) + { + return !ready; + } + return false; + } + + @Override + public void onGuiClosed(EntityPlayer arg0) {} + + @Override + public boolean canBeUsed() + { + return ready; + } + + @Override + public void use() + { + ready=false; + } + + @Override + public boolean getIsInvalid() + { + return this.isInvalid(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } +} -- cgit v1.2.3