summaryrefslogtreecommitdiff
path: root/ihl/processing/metallurgy/LathePart1TileEntity.java
diff options
context:
space:
mode:
authorFoghrye4 <foghrye4@gmail.com>2016-04-11 19:44:54 +0300
committerFoghrye4 <foghrye4@gmail.com>2016-04-11 19:44:54 +0300
commit05c78126859231a68e199dc34613689bd0978e2f (patch)
tree050bea104a18c72905095d29f31bec2935a27a24 /ihl/processing/metallurgy/LathePart1TileEntity.java
Initial commit
Diffstat (limited to 'ihl/processing/metallurgy/LathePart1TileEntity.java')
-rw-r--r--ihl/processing/metallurgy/LathePart1TileEntity.java98
1 files changed, 98 insertions, 0 deletions
diff --git a/ihl/processing/metallurgy/LathePart1TileEntity.java b/ihl/processing/metallurgy/LathePart1TileEntity.java
new file mode 100644
index 0000000..9241ba1
--- /dev/null
+++ b/ihl/processing/metallurgy/LathePart1TileEntity.java
@@ -0,0 +1,98 @@
+package ihl.processing.metallurgy;
+
+import java.util.List;
+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;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class LathePart1TileEntity extends BasicElectricMotorTileEntity implements IWorkspaceElement{
+
+ public boolean ready=false;
+
+ public LathePart1TileEntity()
+ {
+ super();
+ this.isGuiScreenOpened=true;
+ }
+
+
+ @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);
+ }
+
+
+ @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;
+ }
+}