From 2db8e30b1d2151fdde5d08a6c06aef55f0c397d2 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Fri, 27 Jan 2017 11:32:28 +0300 Subject: License, readme and stuff --- .../metallurgy/DrawingDeskTileEntity.java | 173 --------------------- 1 file changed, 173 deletions(-) delete mode 100644 ihl/processing/metallurgy/DrawingDeskTileEntity.java (limited to 'ihl/processing/metallurgy/DrawingDeskTileEntity.java') diff --git a/ihl/processing/metallurgy/DrawingDeskTileEntity.java b/ihl/processing/metallurgy/DrawingDeskTileEntity.java deleted file mode 100644 index aed1a97..0000000 --- a/ihl/processing/metallurgy/DrawingDeskTileEntity.java +++ /dev/null @@ -1,173 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import ic2.api.network.INetworkClientTileEntityEventListener; -import ic2.api.recipe.IRecipeInput; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.IHasGui; -import ic2.core.block.TileEntityInventory; -import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; -import ihl.processing.chemistry.ApparatusProcessableInvSlot; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.recipes.RecipeInputWire; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class DrawingDeskTileEntity extends TileEntityInventory implements IHasGui, INetworkClientTileEntityEventListener -{ - protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("DrawingDesk"); - public short progress; - protected short operationLength=200; - public final ApparatusProcessableInvSlot input; - public final IHLInvSlotOutput output; - boolean isGuiScreenOpened=false; - - public DrawingDeskTileEntity() - { - super(); - input = new ApparatusProcessableInvSlot(this, "input", 0, Access.IO, 1, 64); - output = new IHLInvSlotOutput(this, "output", 1, 1); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - if (this.canOperate() && this.isGuiScreenOpened) - { - this.setActive(true); - - if (this.progress == 0) - { - IC2.network.get().initiateTileEntityEvent(this, 0, true); - } - ++this.progress; - if (this.progress >= this.operationLength) - { - this.operate(); - this.progress = 0; - IC2.network.get().initiateTileEntityEvent(this, 2, true); - } - } - else - { - if (this.progress != 0 && this.getActive()) - { - IC2.network.get().initiateTileEntityEvent(this, 1, true); - } - if (!this.canOperate()) - { - this.progress = 0; - } - this.setActive(false); - } - } - - @Override - public String getInventoryName() { - return "DrawingDesk"; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("DrawingDesk"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new DrawingDeskGui(new DrawingDeskContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - this.isGuiScreenOpened=true; - return new DrawingDeskContainer(player, this); - } - - public void operate() - { - List input1 = DrawingDeskTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); - List output1 = DrawingDeskTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); - this.output.add(output1); - if(input1.get(0) instanceof RecipeInputWire) - { - int fiberLength = input1.get(0).getAmount(); - boolean isFiberConsumed = IHLUtils.adjustWireLength(this.input.get(), -fiberLength); - if(isFiberConsumed) - { - this.input.put(null); - } - } - else - { - this.input.consume(0, input1.get(0).getAmount()); - } - } - - public List[] getInput() - { - return new List[] {null,Arrays.asList(new ItemStack[] {input.get()})}; - } - - public boolean canOperate() - { - if(DrawingDeskTileEntity.recipeManager.getOutputFor(getInput(), false, false)==null) return false; - List output1 = DrawingDeskTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); - return this.output.canAdd(output1); - } - - @Override - public void onGuiClosed(EntityPlayer arg0) {} - - public static void addRecipe(ItemStack input, ItemStack output) - { - if(input==null || output==null) throw new NullPointerException(); - recipeManager.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new ItemStack[] {input})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}),20)); - } - - public int gaugeProgressScaled(int i) - { - return this.progress * i / this.operationLength; - } - - @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - switch(event) - { - case 0: - this.isGuiScreenOpened=false; - break; - } - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - -} -- cgit v1.2.3