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 --- .../chemistry/ApparatusProcessableInvSlot.java | 2 +- ihl/processing/chemistry/BatteryItem.java | 16 +- .../chemistry/ChemicalReactorContainer.java | 4 +- ihl/processing/chemistry/ChemicalReactorGui.java | 5 - .../chemistry/ChemicalReactorTileEntity.java | 67 +------- .../chemistry/CryogenicDistillerContainer.java | 4 +- .../chemistry/CryogenicDistillerGui.java | 5 - .../chemistry/CryogenicDistillerTileEntity.java | 17 +- .../chemistry/ElectricEvaporatorBlock.java | 1 - .../chemistry/ElectricEvaporatorContainer.java | 2 +- .../chemistry/ElectricEvaporatorTileEntity.java | 21 +-- .../chemistry/ElectrolysisBathContainer.java | 2 +- ihl/processing/chemistry/ElectrolysisBathGui.java | 2 +- .../chemistry/ElectrolysisBathTileEntity.java | 13 +- ihl/processing/chemistry/EvaporatorBlock.java | 1 - ihl/processing/chemistry/EvaporatorContainer.java | 2 +- ihl/processing/chemistry/EvaporatorTileEntity.java | 12 +- ihl/processing/chemistry/ExplosiveTileEntity.java | 49 ------ .../chemistry/FluidizedBedReactorContainer.java | 4 +- .../chemistry/FluidizedBedReactorGui.java | 53 +++---- .../chemistry/FluidizedBedReactorTileEntity.java | 83 +++------- .../chemistry/FractionatorBottomTileEntity.java | 5 +- .../chemistry/FractionatorCoverTileEntity.java | 3 +- .../chemistry/FractionatorSectionTileEntity.java | 3 +- .../GaedesMercuryRotaryPumpContainer.java | 4 +- .../chemistry/GaedesMercuryRotaryPumpGui.java | 9 -- .../GaedesMercuryRotaryPumpTileEntity.java | 2 +- .../chemistry/GoldChimneyKneeTileEntity.java | 6 +- .../chemistry/LabElectrolyzerContainer.java | 4 +- ihl/processing/chemistry/LabElectrolyzerGui.java | 6 - .../chemistry/LabElectrolyzerTileEntity.java | 25 +-- ihl/processing/chemistry/LeadOvenContainer.java | 2 +- ihl/processing/chemistry/LeadOvenGui.java | 9 +- ihl/processing/chemistry/LeadOvenTileEntity.java | 22 +-- ihl/processing/chemistry/LoomContainer.java | 2 +- ihl/processing/chemistry/LoomGui.java | 1 - ihl/processing/chemistry/LoomTileEntity.java | 8 +- .../chemistry/PaperMachineContainer.java | 4 +- ihl/processing/chemistry/PaperMachineGui.java | 5 - .../chemistry/PaperMachineTileEntity.java | 65 +------- .../chemistry/PrecipitatorCondenserTileEntity.java | 3 +- .../chemistry/RefluxCondenserTileEntity.java | 3 +- ihl/processing/invslots/IHLInvSlotOutput.java | 6 +- .../invslots/InvSlotConsumableLiquidIHL.java | 8 +- .../invslots/InvSlotSignalProcessor.java | 2 - .../invslots/SlotInvSlotIronWorkbench.java | 31 ++++ ihl/processing/metallurgy/AchesonFurnaceGui.java | 2 - .../metallurgy/AchesonFurnanceTileEntity.java | 9 +- .../metallurgy/BasicElectricMotorTileEntity.java | 43 +++-- ihl/processing/metallurgy/CoilerContainer.java | 4 +- ihl/processing/metallurgy/CoilerGui.java | 4 - ihl/processing/metallurgy/CoilerRender.java | 7 +- ihl/processing/metallurgy/CoilerTileEntity.java | 22 +-- ihl/processing/metallurgy/Crucible.java | 32 +--- ihl/processing/metallurgy/CrucibleContainer.java | 3 +- ihl/processing/metallurgy/CrucibleGui.java | 2 - .../DetonationSprayingMachineContainer.java | 2 +- .../metallurgy/DetonationSprayingMachineGui.java | 11 +- .../metallurgy/DetonationSprayingMachineModel.java | 8 - .../DetonationSprayingMachineRender.java | 2 +- .../DetonationSprayingMachineTileEntity.java | 65 +------- .../metallurgy/DrawingDeskContainer.java | 36 ----- ihl/processing/metallurgy/DrawingDeskGui.java | 59 ------- ihl/processing/metallurgy/DrawingDeskModel.java | 66 -------- .../metallurgy/DrawingDeskTileEntity.java | 173 --------------------- ihl/processing/metallurgy/ElectricEngineItem.java | 4 +- ihl/processing/metallurgy/ExtruderContainer.java | 4 +- ihl/processing/metallurgy/ExtruderGui.java | 9 -- ihl/processing/metallurgy/ExtruderTileEntity.java | 23 +-- .../metallurgy/GasWeldingStationContainer.java | 2 +- .../metallurgy/GasWeldingStationGui.java | 1 - .../metallurgy/GasWeldingStationTileEntity.java | 55 +------ .../metallurgy/ImpregnatingMachineContainer.java | 2 +- .../metallurgy/ImpregnatingMachineTileEntity.java | 57 +------ ihl/processing/metallurgy/InjectionMoldBlock.java | 40 ++--- .../metallurgy/InjectionMoldTileEntity.java | 34 ++-- ihl/processing/metallurgy/LatheContainer.java | 4 +- ihl/processing/metallurgy/LatheGui.java | 9 -- .../metallurgy/LathePart1TileEntity.java | 2 +- .../metallurgy/LathePart2TileEntity.java | 1 - .../metallurgy/MachineBaseTileEntity.java | 6 +- .../metallurgy/MuffleFurnanceTileEntity.java | 4 +- .../metallurgy/RollingMachineContainer.java | 4 +- ihl/processing/metallurgy/RollingMachineGui.java | 9 -- .../metallurgy/RollingMachinePart1TileEntity.java | 20 +-- .../metallurgy/RollingMachinePart2TileEntity.java | 1 - .../metallurgy/RollingMachineRender.java | 7 +- .../VacuumInductionMeltingFurnaceGui.java | 4 +- .../VacuumInductionMeltingFurnaceTileEntity.java | 70 +-------- .../VulcanizationExtrudingMoldTileEntity.java | 3 +- ihl/processing/metallurgy/WireMillContainer.java | 4 +- ihl/processing/metallurgy/WireMillGui.java | 4 - ihl/processing/metallurgy/WireMillTileEntity.java | 13 +- .../metallurgy/WoodenRollingMachineContainer.java | 4 +- .../metallurgy/WoodenRollingMachineGui.java | 9 -- .../WoodenRollingMachinePart1TileEntity.java | 23 +-- .../WoodenRollingMachinePart2TileEntity.java | 1 - .../metallurgy/WoodenRollingMachineRender.java | 11 +- 98 files changed, 297 insertions(+), 1300 deletions(-) delete mode 100644 ihl/processing/chemistry/ExplosiveTileEntity.java create mode 100644 ihl/processing/invslots/SlotInvSlotIronWorkbench.java delete mode 100644 ihl/processing/metallurgy/DrawingDeskContainer.java delete mode 100644 ihl/processing/metallurgy/DrawingDeskGui.java delete mode 100644 ihl/processing/metallurgy/DrawingDeskModel.java delete mode 100644 ihl/processing/metallurgy/DrawingDeskTileEntity.java (limited to 'ihl/processing') diff --git a/ihl/processing/chemistry/ApparatusProcessableInvSlot.java b/ihl/processing/chemistry/ApparatusProcessableInvSlot.java index f0b69b3..3698160 100644 --- a/ihl/processing/chemistry/ApparatusProcessableInvSlot.java +++ b/ihl/processing/chemistry/ApparatusProcessableInvSlot.java @@ -18,7 +18,7 @@ public class ApparatusProcessableInvSlot extends InvSlot { public List getItemStackList() { - List list = new ArrayList(); + List list = new ArrayList(); for(int i=0; i iconMap = new HashMap(); - private static Map nameMap = new HashMap(); - private static Map descriptionMap = new HashMap(); + private static Map iconMap = new HashMap(); + private static Map nameMap = new HashMap(); + private static Map descriptionMap = new HashMap(); public BatteryItem() { @@ -96,7 +96,7 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo @Override public List getHudInfo(ItemStack itemStack) { - LinkedList info = new LinkedList(); + LinkedList info = new LinkedList(); info.add(ElectricItem.manager.getToolTip(itemStack)); return info; } @@ -125,11 +125,8 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo return nameMap.get(0);//stack.getItemDamage()); } - @SideOnly(Side.CLIENT) - - /** - * This returns the sub items - */ + @SideOnly(Side.CLIENT) + @SuppressWarnings({ "rawtypes", "unchecked" }) public void func_150895_a(Item item, CreativeTabs par2CreativeTabs, List itemList) { ItemStack itemStack = new ItemStack(this, 1); @@ -158,6 +155,7 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo } @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { if(BatteryItem.descriptionMap.containsKey(0))//itemStack.getItemDamage())) diff --git a/ihl/processing/chemistry/ChemicalReactorContainer.java b/ihl/processing/chemistry/ChemicalReactorContainer.java index ee60543..a20cc01 100644 --- a/ihl/processing/chemistry/ChemicalReactorContainer.java +++ b/ihl/processing/chemistry/ChemicalReactorContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class ChemicalReactorContainer extends ContainerBase { +public class ChemicalReactorContainer extends ContainerBase { protected ChemicalReactorTileEntity tileEntity; public int lastFluidAmount = -1; @@ -44,7 +44,7 @@ public class ChemicalReactorContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 122, 15)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 122-18, 51)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 122, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 8, 33)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 33)); } @Override diff --git a/ihl/processing/chemistry/ChemicalReactorGui.java b/ihl/processing/chemistry/ChemicalReactorGui.java index 6342d40..029281b 100644 --- a/ihl/processing/chemistry/ChemicalReactorGui.java +++ b/ihl/processing/chemistry/ChemicalReactorGui.java @@ -54,11 +54,6 @@ public class ChemicalReactorGui extends GuiContainer { { IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102-18, 28, 114-18, 59, zLevel, par1, par2, xOffset, yOffset); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(background); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/ChemicalReactorTileEntity.java b/ihl/processing/chemistry/ChemicalReactorTileEntity.java index 7720d2b..cec4177 100644 --- a/ihl/processing/chemistry/ChemicalReactorTileEntity.java +++ b/ihl/processing/chemistry/ChemicalReactorTileEntity.java @@ -50,7 +50,6 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl this.fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1); this.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 2, 64); - this.isGuiScreenOpened=true; } @Override @@ -131,69 +130,12 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl return "chemicalReactor"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - public float getRenderLiquidLevel() { return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity(); } @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - // TODO Auto-generated method stub - } - - @Override public int gaugeProgressScaled(int i) { return this.progress * i / operationLength; @@ -245,11 +187,13 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl return false; } + @SuppressWarnings("unchecked") public UniversalRecipeOutput getOutput() { return ChemicalReactorTileEntity.recipeManager.getOutputFor(this.getInput()[0],this.getInput()[1], false, false); } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { @@ -270,6 +214,7 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl } @Override + @SuppressWarnings({ "unchecked"}) public void operate() { UniversalRecipeInput recipeInput = ChemicalReactorTileEntity.recipeManager.getRecipeInput(this.getInput()[0],this.getInput()[1]); @@ -285,7 +230,7 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl if(te instanceof CryogenicDistillerTileEntity) { CryogenicDistillerTileEntity cgte = (CryogenicDistillerTileEntity)te; - int filled = cgte.fill(ForgeDirection.getOrientation(this.getFacing()), recipeInput.getFluidInputs().get(1).getInputs().get(0), true); + cgte.fill(ForgeDirection.getOrientation(this.getFacing()), recipeInput.getFluidInputs().get(1).getInputs().get(0), true); } } this.fluidTank.drain(recipeInput.getFluidInputs(), true); @@ -347,12 +292,12 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl public static void addRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1, fluidStackInput2}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1, itemStackOutput2}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1, fluidStackInput2}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200)); } public static void addSpecialConditionsRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1, fluidStackInput2}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1, fluidStackInput2}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); } public IHLFluidTank getFluidTank() diff --git a/ihl/processing/chemistry/CryogenicDistillerContainer.java b/ihl/processing/chemistry/CryogenicDistillerContainer.java index d3ed523..be35e2a 100644 --- a/ihl/processing/chemistry/CryogenicDistillerContainer.java +++ b/ihl/processing/chemistry/CryogenicDistillerContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class CryogenicDistillerContainer extends ContainerBase { +public class CryogenicDistillerContainer extends ContainerBase { public CryogenicDistillerTileEntity tileEntity; public int lastProgress = -1; @@ -39,7 +39,7 @@ public class CryogenicDistillerContainer extends ContainerBase { { this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); } - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 8, 32)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 8, 32)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fillInputSlotInput,0, 58, 51)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fillInputSlotProducts,0, 103, 51)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fluidItemsSlot,0, 58, 15)); diff --git a/ihl/processing/chemistry/CryogenicDistillerGui.java b/ihl/processing/chemistry/CryogenicDistillerGui.java index ef18c53..3fbbfa4 100644 --- a/ihl/processing/chemistry/CryogenicDistillerGui.java +++ b/ihl/processing/chemistry/CryogenicDistillerGui.java @@ -42,11 +42,6 @@ public class CryogenicDistillerGui extends GuiContainer { { IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankProducts, 125, 28, 137, 67, zLevel, par1, par2, xOffset, yOffset); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/CryogenicDistillerTileEntity.java b/ihl/processing/chemistry/CryogenicDistillerTileEntity.java index 4c237d3..5a0194f 100644 --- a/ihl/processing/chemistry/CryogenicDistillerTileEntity.java +++ b/ihl/processing/chemistry/CryogenicDistillerTileEntity.java @@ -45,8 +45,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i public CryogenicDistillerTileEntity() { super(); - this.isGuiScreenOpened=true; - this.fillInputSlotInput = new InvSlotConsumableLiquidIHL(this, "fillInputSlotInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); + this.fillInputSlotInput = new InvSlotConsumableLiquidIHL(this, "fillInputSlotInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.fillInputSlotProducts = new InvSlotConsumableLiquidIHL(this, "fillInputSlotProducts", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.fluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 2); } @@ -61,10 +60,9 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i { super.updateEntityServer(); ForgeDirection dir = ForgeDirection.getOrientation(getFacing()); - TileEntity te = worldObj.getTileEntity(xCoord+dir.offsetX,yCoord+dir.offsetY,zCoord+dir.offsetZ); - if(this.processTimer++>20 && this.engine.correctContent() && this.energy>=this.energyConsume/this.engine.getEfficiency()) + if(this.processTimer++>20 && this.energy>=this.energyConsume) { - this.energy-=this.energyConsume/this.engine.getEfficiency(); + this.energy-=this.energyConsume; this.processTimer=0; dir = dir.getOpposite(); Block block = worldObj.getBlock(xCoord+dir.offsetX,yCoord+dir.offsetY,zCoord+dir.offsetZ); @@ -144,6 +142,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i } @Override + @SuppressWarnings({ "unchecked", "rawtypes" }) public List[] getInput() { return new List [] {Arrays.asList(new FluidStack [] {this.fluidTankInput.getLigthestFluid()}),null}; @@ -152,7 +151,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i @Override public boolean canOperate() { - return this.engine.correctContent() && this.getOutput()!=null; + return this.getOutput()!=null; } @Override @@ -182,11 +181,11 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i { if(output2!=null) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {input}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output,output2}),null,20,specialCondition)); + recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] {input},null), new UniversalRecipeOutput(new FluidStack[] {output,output2},null,20,specialCondition)); } else { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {input}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output}),null,20,specialCondition)); + recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] {input},null), new UniversalRecipeOutput(new FluidStack[] {output},null,20,specialCondition)); } } @@ -197,7 +196,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i public boolean canProcess() { - return this.engine.correctContent() && this.energy>=this.maxStorage && this.fluidTankInput.getFluidAmount()<1000; + return this.energy>=this.maxStorage && this.fluidTankInput.getFluidAmount()<1000; } @Override diff --git a/ihl/processing/chemistry/ElectricEvaporatorBlock.java b/ihl/processing/chemistry/ElectricEvaporatorBlock.java index 2507b2e..f65b76d 100644 --- a/ihl/processing/chemistry/ElectricEvaporatorBlock.java +++ b/ihl/processing/chemistry/ElectricEvaporatorBlock.java @@ -185,7 +185,6 @@ public class ElectricEvaporatorBlock extends Block implements ITileEntityProvide @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - IIcon sideIcon = this.blockIcon; switch (side) { case 0: diff --git a/ihl/processing/chemistry/ElectricEvaporatorContainer.java b/ihl/processing/chemistry/ElectricEvaporatorContainer.java index 9dc136e..d981d94 100644 --- a/ihl/processing/chemistry/ElectricEvaporatorContainer.java +++ b/ihl/processing/chemistry/ElectricEvaporatorContainer.java @@ -8,7 +8,7 @@ import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -public class ElectricEvaporatorContainer extends ContainerBase { +public class ElectricEvaporatorContainer extends ContainerBase { protected ElectricEvaporatorTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java b/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java index 3505cda..1b5b647 100644 --- a/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java +++ b/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java @@ -27,7 +27,6 @@ import ic2.core.audio.AudioSource; import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlotUpgrade; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ic2.core.upgrade.IUpgradableBlock; import ic2.core.upgrade.IUpgradeItem; import ic2.core.upgrade.UpgradableProperty; @@ -39,7 +38,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement { public final InvSlotUpgrade upgradeSlot; private int tier; - private int lastTier; public int maxStorage; private int defaultMaxStorage; private double energy; @@ -48,9 +46,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement public final int defaultTier; public int energyConsume; public AudioSource audioSource; - private static final int EventStart = 0; - private static final int EventInterrupt = 1; - private static final int EventStop = 2; private int updateChecksum=0; private boolean addedToEnergyNet=false; @@ -60,7 +55,7 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement this.defaultEnergyConsume = this.energyConsume = 8; this.defaultOperationLength = this.maxProgress = 400; this.energy=0D; - this.lastTier = this.tier = this.defaultTier = 1; + this.tier = this.defaultTier = 1; this.maxStorage = this.defaultMaxStorage = defaultEnergyConsume * defaultOperationLength; this.fuelSlot = new IHLInvSlotDischarge(this, 1, Access.IO, this.tier, InvSlot.InvSide.BOTTOM); this.upgradeSlot = new InvSlotUpgrade(this, "upgrade", 4, 4); @@ -206,7 +201,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement } if(IC2.platform.isSimulating()) { - boolean needsInvUpdate = false; this.setOverclockRates(); if(this.getDemandedEnergy() > 1.0D) @@ -232,7 +226,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement if (this.progress >= this.maxProgress) { this.operate(); - needsInvUpdate = true; this.progress = 0; IC2.network.get().initiateTileEntityEvent(this, 2, true); } @@ -253,20 +246,14 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement { ItemStack stack = this.upgradeSlot.get(i); - if (stack != null && stack.getItem() instanceof IUpgradeItem && ((IUpgradeItem)stack.getItem()).onTick(stack, this)) + if (stack != null && stack.getItem() instanceof IUpgradeItem) { - needsInvUpdate = true; + ((IUpgradeItem)stack.getItem()).onTick(stack, this); } } } } - private static int applyModifier(int base, int extra, double multiplier) - { - double ret = Math.round(((double)base + (double)extra) * multiplier); - return ret > 2.147483647E9D ? Integer.MAX_VALUE : (int)ret; - } - @Override public void onNetworkEvent(int event) { @@ -317,7 +304,7 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement } @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { return new ElectricEvaporatorContainer(entityPlayer, this); } diff --git a/ihl/processing/chemistry/ElectrolysisBathContainer.java b/ihl/processing/chemistry/ElectrolysisBathContainer.java index f2cc74e..9797755 100644 --- a/ihl/processing/chemistry/ElectrolysisBathContainer.java +++ b/ihl/processing/chemistry/ElectrolysisBathContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class ElectrolysisBathContainer extends ContainerBase { +public class ElectrolysisBathContainer extends ContainerBase { protected ElectrolysisBathTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/chemistry/ElectrolysisBathGui.java b/ihl/processing/chemistry/ElectrolysisBathGui.java index cb39044..a7788a5 100644 --- a/ihl/processing/chemistry/ElectrolysisBathGui.java +++ b/ihl/processing/chemistry/ElectrolysisBathGui.java @@ -8,7 +8,6 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import ic2.core.network.NetworkManager; import ihl.collector.GuiMultiTextureButton; import ihl.utils.IHLRenderUtils; @@ -25,6 +24,7 @@ public class ElectrolysisBathGui extends GuiContainer { this.container=container1; } + @SuppressWarnings("unchecked") @Override public void initGui() { diff --git a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java b/ihl/processing/chemistry/ElectrolysisBathTileEntity.java index b549247..5a7a215 100644 --- a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java +++ b/ihl/processing/chemistry/ElectrolysisBathTileEntity.java @@ -1,19 +1,16 @@ package ihl.processing.chemistry; import java.util.Arrays; -import java.util.Iterator; import java.util.List; import java.util.Map; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -23,17 +20,11 @@ import ic2.api.network.INetworkClientTileEntityEventListener; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.IHasGui; -import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlot.Access; import ic2.core.block.invslot.InvSlotConsumableLiquid; import ic2.core.block.invslot.InvSlotOutput; -import ic2.core.network.NetworkManager; -import ihl.IHLMod; import ihl.flexible_cable.FlexibleCableHolderBaseTileEntity; -import ihl.flexible_cable.IHLGrid; -import ihl.flexible_cable.NodeEntity; -import ihl.interfaces.IEnergyNetNode; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.processing.invslots.InvSlotConsumableLiquidIHL; import ihl.recipes.UniversalRecipeInput; @@ -77,7 +68,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit NBTTagCompound fluidTankTag = new NBTTagCompound(); this.fluidTank.writeToNBT(fluidTankTag); nbttagcompound.setTag("fluidTank", fluidTankTag); - NBTTagCompound fractionalOutputNBT = new NBTTagCompound(); } @Override @@ -101,7 +91,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit super.updateEntityServer(); temperature=(short) (this.fluidTank.getTemperature()-273); IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - boolean needsInvUpdate = false; if (this.canOperate()) { this.setActive(true); @@ -120,7 +109,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit if (this.progress >= this.operationLength) { this.operate(); - needsInvUpdate = true; this.progress = 0; IC2.network.get().initiateTileEntityEvent(this, 2, true); } @@ -209,6 +197,7 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit return ElectrolysisBathTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings("rawtypes") public List[] getInput() { for(int i=0;i { protected EvaporatorTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/chemistry/EvaporatorTileEntity.java b/ihl/processing/chemistry/EvaporatorTileEntity.java index e4eb8c0..8160d63 100644 --- a/ihl/processing/chemistry/EvaporatorTileEntity.java +++ b/ihl/processing/chemistry/EvaporatorTileEntity.java @@ -138,7 +138,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen public void updateEntityServer() { super.updateEntityServer(); - boolean needsInvUpdate = false; if (this.needsFluid()) { IHLUtils.handleFluidSlotsBehaviour(fillItemsSlot, fluidItemsSlot, emptyFluidItemsSlot, fluidTank); @@ -146,11 +145,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen if (this.fuel <= 0 && this.canOperate()) { this.fuel = this.maxFuel = ((InvSlotConsumableFuel) this.fuelSlot).consumeFuel(); - - if (this.fuel > 0) - { - needsInvUpdate = true; - } } if (this.isBurning() && this.canOperate()) @@ -161,7 +155,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen { this.progress = 0; this.operate(); - needsInvUpdate = true; } } else @@ -177,7 +170,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen if (this.getActive() != this.isBurning()) { this.setActive(this.isBurning()); - needsInvUpdate = true; } } @@ -219,7 +211,7 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen } @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { return new EvaporatorContainer(entityPlayer, this); } @@ -277,7 +269,7 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen public static void addRecipe(FluidStack input, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack [] {input}),null), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack [] {input}),null), new UniversalRecipeOutput(null, (new ItemStack[] {output}),20)); } public UniversalRecipeOutput getOutput() diff --git a/ihl/processing/chemistry/ExplosiveTileEntity.java b/ihl/processing/chemistry/ExplosiveTileEntity.java deleted file mode 100644 index 777f527..0000000 --- a/ihl/processing/chemistry/ExplosiveTileEntity.java +++ /dev/null @@ -1,49 +0,0 @@ -package ihl.processing.chemistry; - -import ic2.core.ExplosionIC2; -import ic2.core.block.EntityIC2Explosive; -import ihl.utils.EntityIHLExplosion; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class ExplosiveTileEntity extends TileEntity { - - public int explosionPower=10000; - public int explosionType=1; - - public void createExplosion(EntityPlayer player) - { - switch(this.explosionType) - { - case 0: - ExplosionIC2 explosion = new ExplosionIC2(this.worldObj, new EntityIC2Explosive(worldObj), xCoord+0.5d, yCoord+0.5d, zCoord+0.5d, this.explosionPower/1000f, 0f, ExplosionIC2.Type.Normal,player, 0); - System.out.println("Start"); - explosion.doExplosion(); - System.out.println("End"); - break; - case 1: - EntityIHLExplosion ex1 = new EntityIHLExplosion(worldObj, xCoord, yCoord, zCoord,this.explosionPower); - worldObj.spawnEntityInWorld(ex1); - break; - } - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - if(nbt!=null) - { - explosionPower=nbt.getInteger("explosionPower"); - explosionType=nbt.getInteger("explosionType"); - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - nbt.setInteger("explosionPower",explosionPower); - nbt.setInteger("explosionType",explosionType); - } - -} diff --git a/ihl/processing/chemistry/FluidizedBedReactorContainer.java b/ihl/processing/chemistry/FluidizedBedReactorContainer.java index 4d42d29..b2c7738 100644 --- a/ihl/processing/chemistry/FluidizedBedReactorContainer.java +++ b/ihl/processing/chemistry/FluidizedBedReactorContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class FluidizedBedReactorContainer extends ContainerBase { +public class FluidizedBedReactorContainer extends ContainerBase { protected FluidizedBedReactorTileEntity tileEntity; public int lastFluidAmount = -1; @@ -43,7 +43,7 @@ public class FluidizedBedReactorContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 8, 23)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 8, 41)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 43, 33)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 151, 33)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 151, 33)); } @Override diff --git a/ihl/processing/chemistry/FluidizedBedReactorGui.java b/ihl/processing/chemistry/FluidizedBedReactorGui.java index 6d07aca..3b52c38 100644 --- a/ihl/processing/chemistry/FluidizedBedReactorGui.java +++ b/ihl/processing/chemistry/FluidizedBedReactorGui.java @@ -22,35 +22,30 @@ public class FluidizedBedReactorGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); - int i1; - if (this.container.tileEntity.getEnergy() > 0D) - { - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(155, 17 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) - { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(17),17); - this.drawTexturedModalRect(25, 34, 198, 0,i1,13); - if(mixerFrame++>3) - { - mixerFrame=0; - } - this.drawTexturedModalRect(126, 31, 244, 126+26*mixerFrame,12,26); - } - if (this.container.tileEntity.getTankAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 126, 28, 138, 59, zLevel, par1, par2, xOffset, yOffset); - } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(background); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 169, 34, xOffset, yOffset); - } + int xOffset = (this.width - xSize) / 2; + int yOffset = (this.height - ySize) / 2; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); + int i1; + if (this.container.tileEntity.getEnergy() > 0D) + { + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(155, 17 + 12 - i1, 179, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) + { + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(17),17); + this.drawTexturedModalRect(25, 34, 198, 0,i1,13); + if(mixerFrame++>3) + { + mixerFrame=0; + } + this.drawTexturedModalRect(126, 31, 244, 126+26*mixerFrame,12,26); + } + if (this.container.tileEntity.getTankAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 126, 28, 138, 59, zLevel, par1, par2, xOffset, yOffset); + } } @Override diff --git a/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java b/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java index e9b2ec5..0e279b5 100644 --- a/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java +++ b/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java @@ -42,7 +42,6 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity public final InvSlotOutput emptyFluidItemsSlot; private final IHLFluidTank fluidTank = new IHLFluidTank(8000); public short temperature=20; - private int fractionalOutputAmount=0; public FluidizedBedReactorTileEntity() { super(); @@ -51,7 +50,6 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity this.fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1); this.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 2, 64); - this.isGuiScreenOpened=true; } @Override @@ -125,65 +123,8 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity public String getInventoryName() { return "fluidizedBedReactor"; } - - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - - @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - // TODO Auto-generated method stub - } - @Override + @Override public int gaugeProgressScaled(int i) { return this.progress * i / operationLength; @@ -240,6 +181,7 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity return FluidizedBedReactorTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { @@ -267,6 +209,19 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity UniversalRecipeOutput output1 = getOutput(); this.fluidTank.drain(recipeInput.getFluidInputs(), true); this.input.consume(0, recipeInput.getItemInputs().get(0).getAmount()); + if(recipeInput.getItemInputs().get(0).getAmount()==0) + { + ItemStack stack = this.input.get(); + if(stack.stackTagCompound==null) + { + stack.stackTagCompound = new NBTTagCompound(); + } + stack.stackTagCompound.setInteger("catalyst_uses",stack.stackTagCompound.getInteger("catalyst_uses")+1); + if(stack.stackTagCompound.getInteger("catalyst_uses")>1000) + { + this.input.consume(0,1); + } + } if(recipeInput.getItemInputs().size()>1)this.input.consume(1, recipeInput.getItemInputs().get(1).getAmount()); if(output1.getFluidOutputs().size()>0)this.fluidTank.fill(output1.getFluidOutputs().get(0).copy(), true); if(output1.getFluidOutputs().size()>1)this.fluidTank.fill(output1.getFluidOutputs().get(1).copy(), true); @@ -331,11 +286,11 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity { if(fluidStackOutput!=null) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1}),200)); } else { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new ItemStack[] {itemStackOutput1}),200)); } } @@ -347,11 +302,11 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackInput, FluidStack fluidStackOutput, RecipeOutputItemStack itemStackOutput1) { if(fluidStackOutput!=null) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new RecipeOutputItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new RecipeOutputItemStack[] {itemStackOutput1}),200)); } else { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, Arrays.asList(new RecipeOutputItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new RecipeOutputItemStack[] {itemStackOutput1}),200)); } } diff --git a/ihl/processing/chemistry/FractionatorBottomTileEntity.java b/ihl/processing/chemistry/FractionatorBottomTileEntity.java index 41840e0..20132e9 100644 --- a/ihl/processing/chemistry/FractionatorBottomTileEntity.java +++ b/ihl/processing/chemistry/FractionatorBottomTileEntity.java @@ -29,7 +29,6 @@ public class FractionatorBottomTileEntity extends TileEntityInventory { private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("fractionator"); private static float kF = 24000F; - private static float gasC = 1F; private static float fluidC = 4F; private static float H = 2256F; private final IHLFluidTank waterTank = new IHLFluidTank(100); @@ -38,7 +37,7 @@ public class FractionatorBottomTileEntity extends TileEntityInventory private int amountOfFluidEvaporated=0; private int systemHeat=0; private static final int maxSystemHeat=10000; - private final List listOfColumnSections = new ArrayList(); + private final List listOfColumnSections = new ArrayList(); private FractionatorCoverTileEntity columnCover; private RefluxCondenserTileEntity refluxCondenser; private IHeatSource heatSource; @@ -78,7 +77,7 @@ public class FractionatorBottomTileEntity extends TileEntityInventory public static void addRecipe(FluidStack fluidIn, FluidStack fluidOut1, FluidStack fluidOut2) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidIn}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidOut1,fluidOut2}),null,2)); + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidIn}), null), new UniversalRecipeOutput((new FluidStack[] {fluidOut1,fluidOut2}),null,2)); } diff --git a/ihl/processing/chemistry/FractionatorCoverTileEntity.java b/ihl/processing/chemistry/FractionatorCoverTileEntity.java index d7addf2..048f953 100644 --- a/ihl/processing/chemistry/FractionatorCoverTileEntity.java +++ b/ihl/processing/chemistry/FractionatorCoverTileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -32,7 +31,7 @@ public class FractionatorCoverTileEntity extends TileEntity implements IWrenchab @Override public List getNetworkedFields() { - List fields = new ArrayList(); + List fields = new ArrayList(); fields.add("facing"); return fields; } diff --git a/ihl/processing/chemistry/FractionatorSectionTileEntity.java b/ihl/processing/chemistry/FractionatorSectionTileEntity.java index 18314d6..ddd3f31 100644 --- a/ihl/processing/chemistry/FractionatorSectionTileEntity.java +++ b/ihl/processing/chemistry/FractionatorSectionTileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -37,7 +36,7 @@ public class FractionatorSectionTileEntity extends TileEntity implements IWrench @Override public List getNetworkedFields() { - List fields = new ArrayList(); + List fields = new ArrayList(); fields.add("facing"); return fields; } diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java index cbd3239..b283a48 100644 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java +++ b/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class GaedesMercuryRotaryPumpContainer extends ContainerBase { +public class GaedesMercuryRotaryPumpContainer extends ContainerBase { protected GaedesMercuryRotaryPumpTileEntity tileEntity; private final static int height=166; @@ -28,7 +28,7 @@ public class GaedesMercuryRotaryPumpContainer extends ContainerBase { { this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); } - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 61, 36)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 61, 36)); } @Override diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java index 78f1b0c..28c9edc 100644 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java +++ b/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java @@ -2,7 +2,6 @@ package ihl.processing.chemistry; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; @@ -19,9 +18,6 @@ public class GaedesMercuryRotaryPumpGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(tex); int i1; @@ -39,11 +35,6 @@ public class GaedesMercuryRotaryPumpGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); this.drawTexturedModalRect(17, 30, getFrameX(i1), getFrameY(i1),24,24); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 79, 37, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java index 3a9b814..3227ab7 100644 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java +++ b/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java @@ -18,7 +18,6 @@ public class GaedesMercuryRotaryPumpTileEntity extends BasicElectricMotorTileEnt public GaedesMercuryRotaryPumpTileEntity() { - this.isGuiScreenOpened=true; } @Override @@ -33,6 +32,7 @@ public class GaedesMercuryRotaryPumpTileEntity extends BasicElectricMotorTileEnt return IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump"); } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { diff --git a/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java b/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java index 6c73a5b..34b3de2 100644 --- a/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java +++ b/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java @@ -8,7 +8,6 @@ import java.util.Map; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; import ihl.recipes.UniversalRecipeOutput; @@ -52,7 +51,7 @@ public class GoldChimneyKneeTileEntity extends TileEntity implements IWrenchable @Override public List getNetworkedFields() { - List fields = new ArrayList(); + List fields = new ArrayList(); fields.add("facing"); return fields; } @@ -273,7 +272,7 @@ public class GoldChimneyKneeTileEntity extends TileEntity implements IWrenchable public static void addRecipe(UniversalRecipeInput input, FluidStack fluidStackWithSize) { - recipeManager.addRecipe(input, new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackWithSize}),null,20)); + recipeManager.addRecipe(input, new UniversalRecipeOutput((new FluidStack[] {fluidStackWithSize}),null,20)); } public UniversalRecipeOutput getOutput() @@ -281,6 +280,7 @@ public class GoldChimneyKneeTileEntity extends TileEntity implements IWrenchable return GoldChimneyKneeTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings("rawtypes") public List[] getInput() { return new List[] {Arrays.asList(new FluidStack[] {this.gasBuffer.getFluid(),this.fluidTank.getFluid()}),null}; diff --git a/ihl/processing/chemistry/LabElectrolyzerContainer.java b/ihl/processing/chemistry/LabElectrolyzerContainer.java index 5ee9caf..b1fec2f 100644 --- a/ihl/processing/chemistry/LabElectrolyzerContainer.java +++ b/ihl/processing/chemistry/LabElectrolyzerContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class LabElectrolyzerContainer extends ContainerBase { +public class LabElectrolyzerContainer extends ContainerBase { protected LabElectrolyzerTileEntity tileEntity; public short lastProgress = -1; @@ -53,7 +53,7 @@ public class LabElectrolyzerContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 1, 42, 33)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 2, 106, 15)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 87, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 152, 15)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 152, 15)); } @Override diff --git a/ihl/processing/chemistry/LabElectrolyzerGui.java b/ihl/processing/chemistry/LabElectrolyzerGui.java index c5997ca..aea51f8 100644 --- a/ihl/processing/chemistry/LabElectrolyzerGui.java +++ b/ihl/processing/chemistry/LabElectrolyzerGui.java @@ -12,7 +12,6 @@ import ihl.utils.IHLRenderUtils; public class LabElectrolyzerGui extends GuiContainer { private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUILabElectrolyzer.png"); private LabElectrolyzerContainer container; - private int mixerFrame=0; public LabElectrolyzerGui (LabElectrolyzerContainer container1) { //the container is instanciated and passed to the superclass for handling @@ -53,11 +52,6 @@ public class LabElectrolyzerGui extends GuiContainer { { IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankAnodeOutput, 125, 28, 137, 67, zLevel, par1, par2, xOffset, yOffset); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(background); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 170, 16, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/LabElectrolyzerTileEntity.java b/ihl/processing/chemistry/LabElectrolyzerTileEntity.java index cde3e39..10feef6 100644 --- a/ihl/processing/chemistry/LabElectrolyzerTileEntity.java +++ b/ihl/processing/chemistry/LabElectrolyzerTileEntity.java @@ -10,7 +10,6 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -52,7 +51,6 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl this.fillInputSlotAnodeOutput = new InvSlotConsumableLiquidIHL(this, "fillInputAnodeOutput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.fillInputSlotCathodeOutput = new InvSlotConsumableLiquidIHL(this, "fillInputCathodeOutput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 3); - this.isGuiScreenOpened=true; } @Override @@ -142,12 +140,6 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl return "labElectrolizer"; } - @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - // TODO Auto-generated method stub - } - @Override public int gaugeProgressScaled(int i) { @@ -188,23 +180,12 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl return false; } - private boolean checkSpecialConditions() - { - ForgeDirection dir = ForgeDirection.getOrientation(this.getFacing()); - TileEntity te = worldObj.getTileEntity(xCoord+dir.offsetX, yCoord, zCoord+dir.offsetZ); - if(te instanceof CryogenicDistillerTileEntity) - { - CryogenicDistillerTileEntity cgte = (CryogenicDistillerTileEntity)te; - return cgte.getFacing()==this.getFacing() && cgte.canProcess(); - } - return false; - } - public UniversalRecipeOutput getOutput() { return LabElectrolyzerTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { @@ -282,11 +263,11 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl { if(itemStackOutput1!=null) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), Arrays.asList(new ItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), (new ItemStack[] {itemStackOutput1}),200)); } else { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), null,200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), null,200)); } } diff --git a/ihl/processing/chemistry/LeadOvenContainer.java b/ihl/processing/chemistry/LeadOvenContainer.java index aa0eafc..c273623 100644 --- a/ihl/processing/chemistry/LeadOvenContainer.java +++ b/ihl/processing/chemistry/LeadOvenContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class LeadOvenContainer extends ContainerBase { +public class LeadOvenContainer extends ContainerBase { protected LeadOvenTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/chemistry/LeadOvenGui.java b/ihl/processing/chemistry/LeadOvenGui.java index 133cb4e..2d8e785 100644 --- a/ihl/processing/chemistry/LeadOvenGui.java +++ b/ihl/processing/chemistry/LeadOvenGui.java @@ -5,15 +5,12 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class LeadOvenGui extends GuiContainer { private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUILeadOven.png"); private LeadOvenContainer container; - private String title = StatCollector.translateToLocal("ihl.gui.leadOven"); - public LeadOvenGui (LeadOvenContainer container1) { //the container is instanciated and passed to the superclass for handling @@ -23,10 +20,8 @@ public class LeadOvenGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); } @Override diff --git a/ihl/processing/chemistry/LeadOvenTileEntity.java b/ihl/processing/chemistry/LeadOvenTileEntity.java index 01f69bf..340d848 100644 --- a/ihl/processing/chemistry/LeadOvenTileEntity.java +++ b/ihl/processing/chemistry/LeadOvenTileEntity.java @@ -24,6 +24,7 @@ import ic2.core.block.TileEntityLiquidTankInventory; import ic2.core.block.invslot.InvSlotConsumableFuel; import ic2.core.block.invslot.InvSlot.Access; import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.recipes.RecipeOutputItemStack; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; import ihl.recipes.UniversalRecipeOutput; @@ -152,7 +153,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements } } } - boolean needsInvUpdate = false; if (this.fuel <= 0 && this.canOperate()) { if(this.fuelSlot.get()!=null) @@ -168,11 +168,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements } } this.fuel = this.maxFuel = this.fuelSlot.consumeFuel(); - - if (this.fuel > 0) - { - needsInvUpdate = true; - } } if (this.isBurning() && this.canOperate()) @@ -183,7 +178,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements { this.progress = 0; this.operate(); - needsInvUpdate = true; } } else @@ -199,7 +193,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements if (this.getActive() != this.isBurning()) { this.setActive(this.isBurning()); - needsInvUpdate = true; } } @@ -223,12 +216,12 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements } @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { return new LeadOvenContainer(entityPlayer, this); } - @Override + @Override @SideOnly(Side.CLIENT) public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) { @@ -269,6 +262,7 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements return LeadOvenTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings("rawtypes") public List[] getInput() { if(this.inputSlot.get(1)!=null) @@ -287,7 +281,7 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements { this.getFluidTank().fill(output2.get(0), true); } - List itemOutputs = routput.getItemOutputs(); + List itemOutputs = routput.getItemOutputs(); if(itemOutputs!=null && !itemOutputs.isEmpty()) { this.outputSlot.add(itemOutputs); @@ -326,7 +320,7 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements public static void addRecipe(UniversalRecipeInput input, FluidStack fluidStackWithSize) { - recipeManager.addRecipe(input, new UniversalRecipeOutput(Arrays.asList(new FluidStack[]{fluidStackWithSize}),null,20)); + recipeManager.addRecipe(input, new UniversalRecipeOutput((new FluidStack[]{fluidStackWithSize}),null,20)); } public static Map getRecipes() { @@ -334,10 +328,10 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements } public static void addRecipe(ItemStack input, FluidStack fluidStackOutput, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input})),new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}),Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input})),new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}),(new ItemStack[] {output}),20)); } public static void addRecipe(ItemStack input, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input})),new UniversalRecipeOutput(null,(new ItemStack[] {output}),20)); } } \ No newline at end of file diff --git a/ihl/processing/chemistry/LoomContainer.java b/ihl/processing/chemistry/LoomContainer.java index 4b8e182..2d480ef 100644 --- a/ihl/processing/chemistry/LoomContainer.java +++ b/ihl/processing/chemistry/LoomContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class LoomContainer extends ContainerBase { +public class LoomContainer extends ContainerBase { public LoomTileEntity tileEntity; public int lastProgress = -1; diff --git a/ihl/processing/chemistry/LoomGui.java b/ihl/processing/chemistry/LoomGui.java index 1052252..4964687 100644 --- a/ihl/processing/chemistry/LoomGui.java +++ b/ihl/processing/chemistry/LoomGui.java @@ -3,7 +3,6 @@ package ihl.processing.chemistry; import org.lwjgl.opengl.GL11; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; diff --git a/ihl/processing/chemistry/LoomTileEntity.java b/ihl/processing/chemistry/LoomTileEntity.java index df5ce20..e81680d 100644 --- a/ihl/processing/chemistry/LoomTileEntity.java +++ b/ihl/processing/chemistry/LoomTileEntity.java @@ -11,7 +11,6 @@ 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; @@ -106,7 +105,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet public void operate() { List input1 = LoomTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); - List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); + List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); this.output.add(output1); if(input1.get(0) instanceof RecipeInputWire) { @@ -123,6 +122,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet } } + @SuppressWarnings("rawtypes") public List[] getInput() { return new List[] {null,Arrays.asList(new ItemStack[] {input.get()})}; @@ -131,7 +131,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet public boolean canOperate() { if(LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false)==null) return false; - List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); + List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); return this.output.canAdd(output1); } @@ -141,7 +141,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet 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)); + recipeManager.addRecipe(new UniversalRecipeInput(null,new ItemStack[] {input}), new UniversalRecipeOutput(null, new ItemStack[] {output},20)); } public int gaugeProgressScaled(int i) diff --git a/ihl/processing/chemistry/PaperMachineContainer.java b/ihl/processing/chemistry/PaperMachineContainer.java index 99bfa61..ea07afc 100644 --- a/ihl/processing/chemistry/PaperMachineContainer.java +++ b/ihl/processing/chemistry/PaperMachineContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class PaperMachineContainer extends ContainerBase { +public class PaperMachineContainer extends ContainerBase { protected PaperMachineTileEntity tileEntity; public int lastFluidAmount = -1; @@ -41,7 +41,7 @@ public class PaperMachineContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 78, 15)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 78, 33)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 122, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 8, 32)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 32)); } @Override diff --git a/ihl/processing/chemistry/PaperMachineGui.java b/ihl/processing/chemistry/PaperMachineGui.java index 4c8cb72..b65f041 100644 --- a/ihl/processing/chemistry/PaperMachineGui.java +++ b/ihl/processing/chemistry/PaperMachineGui.java @@ -54,11 +54,6 @@ public class PaperMachineGui extends GuiContainer { { IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102, 28, 114, 59, zLevel, par1, par2, xOffset, yOffset); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(background); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/PaperMachineTileEntity.java b/ihl/processing/chemistry/PaperMachineTileEntity.java index a694b82..4784d38 100644 --- a/ihl/processing/chemistry/PaperMachineTileEntity.java +++ b/ihl/processing/chemistry/PaperMachineTileEntity.java @@ -39,7 +39,6 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme public final InvSlotOutput emptyFluidItemsSlot; private final IHLFluidTank fluidTank = new IHLFluidTank(8000); public short temperature=20; - private int fractionalOutputAmount=0; public PaperMachineTileEntity() { super(); @@ -47,7 +46,6 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme this.drainInputSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Drain); this.fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1); - this.isGuiScreenOpened=true; } @Override @@ -64,7 +62,6 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme NBTTagCompound fluidTankTag = new NBTTagCompound(); this.fluidTank.writeToNBT(fluidTankTag); nbttagcompound.setTag("fluidTank", fluidTankTag); - NBTTagCompound fractionalOutputNBT = new NBTTagCompound(); } @Override @@ -115,69 +112,12 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme return "chemicalReactor"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - public float getRenderLiquidLevel() { return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity(); } @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - // TODO Auto-generated method stub - } - - @Override public int gaugeProgressScaled(int i) { return this.progress * i / operationLength; @@ -235,6 +175,7 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme } @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public List[] getInput() { return new List[] {Arrays.asList(new FluidStack[]{fluidTank.getFluid()}), null}; @@ -304,12 +245,12 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackOutput1) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(null, (new ItemStack[] {itemStackOutput1}),200)); } public static void addSpecialConditionsRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1, fluidStackInput2}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); + addRecipe(new UniversalRecipeInput(new FluidStack[] {fluidStackInput1, fluidStackInput2}, (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); } public IHLFluidTank getFluidTank() diff --git a/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java b/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java index becd7e8..6f3b43f 100644 --- a/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java +++ b/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java @@ -25,7 +25,6 @@ public class PrecipitatorCondenserTileEntity extends TileEntityInventory impleme { private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("precipitatorcondenser"); private static float kF = 24000F; - private static float gasC = 1F; private static float fluidC = 4F; private static float H = 2256F; private final IHLFluidTank gasBuffer = new IHLFluidTank(10000); @@ -49,7 +48,7 @@ public class PrecipitatorCondenserTileEntity extends TileEntityInventory impleme public static void addRecipe(String fluidNameIn, String fluidNameOut, int conversionRateToGas) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameIn, conversionRateToGas)}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameOut, 1)}),null,2)); + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameIn, conversionRateToGas)}), null), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameOut, 1)}),null,2)); } @Override diff --git a/ihl/processing/chemistry/RefluxCondenserTileEntity.java b/ihl/processing/chemistry/RefluxCondenserTileEntity.java index 91366fb..b6cbcb0 100644 --- a/ihl/processing/chemistry/RefluxCondenserTileEntity.java +++ b/ihl/processing/chemistry/RefluxCondenserTileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -37,7 +36,7 @@ public class RefluxCondenserTileEntity extends TileEntity implements IWrenchable @Override public List getNetworkedFields() { - List fields = new ArrayList(); + List fields = new ArrayList(); fields.add("facing"); return fields; } diff --git a/ihl/processing/invslots/IHLInvSlotOutput.java b/ihl/processing/invslots/IHLInvSlotOutput.java index 94bf3c8..7e10ab3 100644 --- a/ihl/processing/invslots/IHLInvSlotOutput.java +++ b/ihl/processing/invslots/IHLInvSlotOutput.java @@ -18,11 +18,12 @@ import ihl.utils.IHLUtils; public class IHLInvSlotOutput extends InvSlotOutput{ - private final Map substanceAmount = new HashMap(); + private final Map substanceAmount = new HashMap(); public IHLInvSlotOutput(TileEntityInventory base1, String name1, int oldStartIndex1, int count) { super(base1, name1, oldStartIndex1, count); } + @SuppressWarnings("rawtypes") @Override public boolean canAdd(List itemOutputs) { @@ -82,7 +83,6 @@ public class IHLInvSlotOutput extends InvSlotOutput{ public boolean objectMatchesSlot(Object obj, int slot) { - boolean matches=true; if(this.get(slot)==null) { return true; @@ -131,6 +131,7 @@ public class IHLInvSlotOutput extends InvSlotOutput{ } @Override + @SuppressWarnings("rawtypes") public int add(List itemOutputs) { if(itemOutputs==null || itemOutputs.isEmpty()) @@ -196,7 +197,6 @@ public class IHLInvSlotOutput extends InvSlotOutput{ { super.writeToNbt(nbtTagCompound); NBTTagList sAmountsList = new NBTTagList(); - int i = 0; Iterator> entrySetIterator = this.substanceAmount.entrySet().iterator(); while(entrySetIterator.hasNext()) { diff --git a/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java b/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java index c88584e..0a3b664 100644 --- a/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java +++ b/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java @@ -225,11 +225,11 @@ public class InvSlotConsumableLiquidIHL extends InvSlotConsumableLiquid{ return true; } - Iterator containerItem1 = this.getPossibleFluids().iterator(); + Iterator containerItem1 = this.getPossibleFluids().iterator(); while (containerItem1.hasNext()) { - Fluid prevFluid = (Fluid)containerItem1.next(); + Fluid prevFluid = containerItem1.next(); if (FluidContainerRegistry.fillFluidContainer(new FluidStack(prevFluid, Integer.MAX_VALUE), stack) != null) { @@ -250,11 +250,11 @@ public class InvSlotConsumableLiquidIHL extends InvSlotConsumableLiquid{ } ItemStack singleStack = StackUtil.copyWithSize(stack, 1); - Iterator i$ = this.getPossibleFluids().iterator(); + Iterator i$ = this.getPossibleFluids().iterator(); while (i$.hasNext()) { - Fluid fluid = (Fluid)i$.next(); + Fluid fluid = i$.next(); if (containerItem2.fill(singleStack, new FluidStack(fluid, Integer.MAX_VALUE), false) > 0) { diff --git a/ihl/processing/invslots/InvSlotSignalProcessor.java b/ihl/processing/invslots/InvSlotSignalProcessor.java index 6663db0..f66ab13 100644 --- a/ihl/processing/invslots/InvSlotSignalProcessor.java +++ b/ihl/processing/invslots/InvSlotSignalProcessor.java @@ -1,11 +1,9 @@ package ihl.processing.invslots; -import java.util.Iterator; import net.minecraft.block.Block; import net.minecraftforge.common.util.ForgeDirection; import ic2.core.Ic2Items; import ic2.core.block.invslot.InvSlot; -import ihl.IHLMod; import ihl.datanet.Contact; import ihl.datanet.RedstoneSignalConverterTileEntity; import ihl.interfaces.IDataNode; diff --git a/ihl/processing/invslots/SlotInvSlotIronWorkbench.java b/ihl/processing/invslots/SlotInvSlotIronWorkbench.java new file mode 100644 index 0000000..94354ea --- /dev/null +++ b/ihl/processing/invslots/SlotInvSlotIronWorkbench.java @@ -0,0 +1,31 @@ +package ihl.processing.invslots; + +import net.minecraft.entity.player.EntityPlayer; +import ic2.core.slot.SlotInvSlot; +import ihl.flexible_cable.*; + +public class SlotInvSlotIronWorkbench extends SlotInvSlot { + + public IronWorkbenchInvSlot invSlot; + + public SlotInvSlotIronWorkbench(IronWorkbenchInvSlot invSlot1, int index1, + int xDisplayPosition1, int yDisplayPosition1) { + super(invSlot1, index1, xDisplayPosition1, yDisplayPosition1); + this.invSlot=invSlot1; + + } + + @Override + public boolean canTakeStack(EntityPlayer player) + { + return this.invSlot.getCanTakeStack(); + } + + + @Override + public void onSlotChanged() + { + super.onSlotChanged(); + ((IronWorkbenchTileEntity)this.invSlot.base).resetOutput(); + } +} diff --git a/ihl/processing/metallurgy/AchesonFurnaceGui.java b/ihl/processing/metallurgy/AchesonFurnaceGui.java index bafa530..70e9d05 100644 --- a/ihl/processing/metallurgy/AchesonFurnaceGui.java +++ b/ihl/processing/metallurgy/AchesonFurnaceGui.java @@ -17,8 +17,6 @@ public class AchesonFurnaceGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(achesonFurnaceBackground); int i1; diff --git a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java index 5d228fc..0c1b75f 100644 --- a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java +++ b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java @@ -1,6 +1,5 @@ package ihl.processing.metallurgy; -import java.util.Arrays; import java.util.List; import java.util.Map; @@ -35,7 +34,7 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{ public static void addRecipe(IRecipeInput input1, IRecipeInput input2, String output1) { - recipeManager.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new IRecipeInput [] {input1,input2})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack [] {IHLUtils.getThisModItemStack(output1)}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null,new IRecipeInput [] {input1,input2}),new UniversalRecipeOutput(null,new ItemStack [] {IHLUtils.getThisModItemStack(output1)},20)); } @Override @@ -46,13 +45,11 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{ @Override public String getLoopSoundFile() { - // TODO Auto-generated method stub return null; } @Override public String getStopSoundFile() { - // TODO Auto-generated method stub return null; } @@ -104,7 +101,7 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{ ItemStack crucible = input.getItemStack(IHLMod.crucible); if(crucible!=null) { - ItemStack stack = ((Crucible)crucible.getItem()).processContent(crucible, this); + ((Crucible)crucible.getItem()).processContent(crucible, this); } } @@ -117,7 +114,7 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{ } @Override - public List[] getInput() + public List[] getInput() { return new List[] {null, this.input.getItemStackList()}; } diff --git a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java index 11865a4..47cfda9 100644 --- a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java +++ b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java @@ -9,18 +9,12 @@ import ic2.api.energy.tile.IEnergySink; import ic2.api.network.INetworkClientTileEntityEventListener; import ic2.core.IC2; import ic2.core.IHasGui; -import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; -import ihl.IHLMod; import ihl.flexible_cable.FlexibleCableHolderBaseTileEntity; -import ihl.flexible_cable.IHLGrid; import ihl.flexible_cable.NodeEntity; -import ihl.interfaces.IEnergyNetNode; -import ihl.utils.IHLUtils; -import net.minecraft.entity.item.EntityItem; +import ihl.utils.IHLInvSlotDischarge; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; @@ -29,10 +23,9 @@ import net.minecraftforge.common.util.ForgeDirection; public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBaseTileEntity implements IHasGui, INetworkClientTileEntityEventListener, IEnergySink{ - public final ElectricEngineInvSlot engine; + public final IHLInvSlotDischarge dischargeSlot; public short progress; protected short operationLength=600; - public boolean isGuiScreenOpened=false; protected final double energyConsume=0.1D; public double energy; public int maxStorage=128; @@ -41,7 +34,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa public BasicElectricMotorTileEntity() { super(); - engine = new ElectricEngineInvSlot(this, "engine", 0, Access.IO, 1, 1); + dischargeSlot = new IHLInvSlotDischarge(this, 1, Access.IO, 4, InvSlot.InvSide.BOTTOM); } @@ -79,6 +72,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa } + @SuppressWarnings("unchecked") @Override public void setFacing(short facing1) { @@ -125,10 +119,10 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa } if(!nodeList.isEmpty()) { - Iterator ei = nodeList.iterator(); + Iterator ei = nodeList.iterator(); while(ei.hasNext()) { - NodeEntity ne=(NodeEntity) ei.next(); + NodeEntity ne= ei.next(); if((ne.prevAnchorEntity==null||ne.nextAnchorEntity==null) && this.cableListContains(ne.getChainUniqueID())) { ne.setVirtualNodePos(connectionX,connectionY,connectionZ); @@ -194,7 +188,6 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa switch(event) { case 0: - this.isGuiScreenOpened=false; break; } } @@ -204,14 +197,19 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa @Override public void updateEntityServer() { - if(this.gridID!=-1 && this.getGrid().energy>0D && this.energy=this.energyConsume/this.engine.getEfficiency()) + if(this.getDemandedEnergy() > 1.0D) + { + double amount = this.dischargeSlot.discharge(this.getDemandedEnergy(), false); + this.energy += amount; + } + if(this.gridID!=-1 && this.getGrid().energy>0D && this.energy=this.energyConsume) + { + this.energy-=this.energyConsume; if (this.progress == 0) { IC2.network.get().initiateTileEntityEvent(this, 0, true); @@ -238,7 +236,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa } - public abstract List[] getInput(); + public abstract List[] getInput(); public abstract boolean canOperate(); @Override public void onGuiClosed(EntityPlayer arg0) {} @@ -294,6 +292,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa return 0d; } + @Override public void injectEnergyInThisNode(double amount, double voltage) { this.energy+=amount; diff --git a/ihl/processing/metallurgy/CoilerContainer.java b/ihl/processing/metallurgy/CoilerContainer.java index ba809d2..710a708 100644 --- a/ihl/processing/metallurgy/CoilerContainer.java +++ b/ihl/processing/metallurgy/CoilerContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class CoilerContainer extends ContainerBase { +public class CoilerContainer extends ContainerBase { public CoilerTileEntity tileEntity; private short lastEnergy = -1; @@ -31,7 +31,7 @@ public class CoilerContainer extends ContainerBase { this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); } this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 69, 22)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); } @Override diff --git a/ihl/processing/metallurgy/CoilerGui.java b/ihl/processing/metallurgy/CoilerGui.java index fd3b7cd..b635506 100644 --- a/ihl/processing/metallurgy/CoilerGui.java +++ b/ihl/processing/metallurgy/CoilerGui.java @@ -31,10 +31,6 @@ public class CoilerGui extends GuiContainer { { i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); this.drawTexturedModalRect(39, 55 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - if(!this.container.tileEntity.engine.correctContent()) - { - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset); } IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.coiler.tip")); } diff --git a/ihl/processing/metallurgy/CoilerRender.java b/ihl/processing/metallurgy/CoilerRender.java index 646b342..f3da8fa 100644 --- a/ihl/processing/metallurgy/CoilerRender.java +++ b/ihl/processing/metallurgy/CoilerRender.java @@ -70,11 +70,8 @@ private final float scale=1F/16F; { model.CoilRotating.render(scale); } - if(cte.hasEngine) - { - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - } + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); } model.RotatingPart2.render(scale); GL11.glPopMatrix(); //end diff --git a/ihl/processing/metallurgy/CoilerTileEntity.java b/ihl/processing/metallurgy/CoilerTileEntity.java index 6a671b0..5fdcf13 100644 --- a/ihl/processing/metallurgy/CoilerTileEntity.java +++ b/ihl/processing/metallurgy/CoilerTileEntity.java @@ -5,7 +5,6 @@ import java.util.List; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.block.invslot.InvSlotOutput; -import ic2.core.network.NetworkManager; import ihl.interfaces.IWire; import ihl.utils.IHLUtils; import net.minecraft.client.gui.GuiScreen; @@ -19,13 +18,11 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP public final InvSlotOutput output; private int activeTimer=0; public boolean hasCoil=false; - public boolean hasEngine=false; public CoilerTileEntity() { super(); this.output = new InvSlotOutput(this, "output", 1, 1); - this.isGuiScreenOpened=true; } @@ -39,7 +36,6 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP { List fields = super.getNetworkedFields(); fields.add("hasCoil"); - fields.add("hasEngine"); return fields; } @@ -89,34 +85,22 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP this.hasCoil=true; IC2.network.get().updateTileEntityField(this, "hasCoil"); } - if(this.engine.isEmpty() && hasEngine==true) - { - this.hasEngine=false; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - else if(this.engine.correctContent() && hasEngine==false) - { - this.hasEngine=true; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - } @Override public void operate() {} - + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { return null; } - @Override public boolean canProcess(ItemStack cable) { - if(this.engine.correctContent() && this.energy>1D/this.engine.getEfficiency() && cable.getItem() instanceof IWire) + if(this.energy>1D && cable.getItem() instanceof IWire) { if(this.output.isEmpty()) { @@ -139,7 +123,7 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP public void process(ItemStack cable) { if(cable.getItem() instanceof IWire) { - this.energy-=1D/this.engine.getEfficiency(); + this.energy-=1D; if(this.output.isEmpty()) { setActive(true); diff --git a/ihl/processing/metallurgy/Crucible.java b/ihl/processing/metallurgy/Crucible.java index a435e49..3f14f48 100644 --- a/ihl/processing/metallurgy/Crucible.java +++ b/ihl/processing/metallurgy/Crucible.java @@ -25,7 +25,6 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidHandler; -import net.minecraftforge.oredict.OreDictionary; import ic2.api.item.IItemHudInfo; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; @@ -62,7 +61,7 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine public static void addRecipe(String string, FluidStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new IRecipeInput[] {new RecipeInputOreDict(string)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output}),null,20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, new IRecipeInput[] {new RecipeInputOreDict(string)}), new UniversalRecipeOutput(new FluidStack[] {output},null,20)); } @Override @@ -84,7 +83,8 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine /** * allows items to add custom lines of information to the mouseover description */ - @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { super.addInformation(itemStack, player, info, b); @@ -103,7 +103,7 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine @Override public List getHudInfo(ItemStack itemStack) { - LinkedList info = new LinkedList(); + LinkedList info = new LinkedList(); FluidStack fs = this.getFluid(itemStack); if (fs != null) @@ -249,29 +249,7 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine } } } - private String getFormattedFluidNameFromMaterialName(String input) - { - if(input.length()<6) - { - return ""; - } - String input2 = input.substring(5); - return "molten."+input2.toLowerCase(); - } - - private String getOreName(ItemStack stack) - { - int[] arrayIDs = OreDictionary.getOreIDs(stack); - for(int i=0; i if (stack != null) { - NBTTagCompound nbtTagCompoundSlot = StackUtil.getOrCreateNbtData(stack); + StackUtil.getOrCreateNbtData(stack); if (this.box.isThisContainer(stack)) { diff --git a/ihl/processing/metallurgy/CrucibleGui.java b/ihl/processing/metallurgy/CrucibleGui.java index b0bfc85..e92347c 100644 --- a/ihl/processing/metallurgy/CrucibleGui.java +++ b/ihl/processing/metallurgy/CrucibleGui.java @@ -27,8 +27,6 @@ public class CrucibleGui extends GuiContainer @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; fontRendererObj.drawString(title, 68, 0, 6171880); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java b/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java index 3bfd2b0..94d479c 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java @@ -5,7 +5,7 @@ import ic2.core.slot.SlotInvSlot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; -public class DetonationSprayingMachineContainer extends ContainerBase { +public class DetonationSprayingMachineContainer extends ContainerBase { protected DetonationSprayingMachineTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineGui.java b/ihl/processing/metallurgy/DetonationSprayingMachineGui.java index cc4d455..66d9acb 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineGui.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineGui.java @@ -17,24 +17,21 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class DetonationSprayingMachineGui extends GuiContainer { private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIDetonationSprayingMachine.png"); - private DetonationSprayingMachineContainer container; private static final String hint = StatCollector.translateToLocal("ihl.dsmhint"); public DetonationSprayingMachineGui (DetonationSprayingMachineContainer detonationSprayingMachineContainer) { //the container is instanciated and passed to the superclass for handling super(detonationSprayingMachineContainer); - this.container=detonationSprayingMachineContainer; } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); } - @Override + @SuppressWarnings("unchecked") + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { //draw your Gui here, only thing you need to change is the path diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineModel.java b/ihl/processing/metallurgy/DetonationSprayingMachineModel.java index 48329d5..7335125 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineModel.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineModel.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import ihl.model.IHLModelRenderer; import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraftforge.common.util.ForgeDirection; @@ -48,13 +47,6 @@ public class DetonationSprayingMachineModel extends ModelBase { Base.addTube("Tube11", -1F, 10F, -8F, 2, 2, 1, 0F,1F,ForgeDirection.NORTH); } - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - @Override public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineRender.java b/ihl/processing/metallurgy/DetonationSprayingMachineRender.java index 9bb0c6e..ee64b65 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineRender.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineRender.java @@ -49,7 +49,7 @@ public void renderAModelAt(DetonationSprayingMachineTileEntity tile, double x, d bindTexture(tex); //texture GL11.glScalef(1F, -1F, -1F); GL11.glTranslatef(0F, -1.0F, 0F); - model.Base.render(1.0F/16.0F); + model.Base.render(scale); GL11.glPopMatrix(); } diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java b/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java index 590f6e9..f9d2cb6 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java @@ -23,7 +23,6 @@ import ic2.core.audio.AudioSource; import ic2.core.audio.PositionSpec; import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.recipes.RecipeOutputItemStack; import ihl.recipes.UniversalRecipeInput; @@ -76,58 +75,6 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp return "detonationSprayingMachine"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - - @Override public void onNetworkEvent(int event) { @@ -158,7 +105,7 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp return DetonationSprayingMachineTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } - public List[] getInput() + public List[] getInput() { return new List[] {null,this.input.getItemStackList()}; } @@ -226,11 +173,11 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp public static void addRecipe(ItemStack input, ItemStack output) { - List dsmInputs1 = new ArrayList(); - dsmInputs1.add(new RecipeInputItemStack(input)); - dsmInputs1.add(new RecipeInputOreDict("dustDiamond")); - dsmInputs1.add(new RecipeInputOreDict("dustGunpowder")); - recipeManager.addRecipe(new UniversalRecipeInput(null, dsmInputs1), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),1)); + IRecipeInput[] dsmInputs1 = new IRecipeInput[3]; + dsmInputs1[0]=new RecipeInputItemStack(input); + dsmInputs1[1]=new RecipeInputOreDict("dustDiamond"); + dsmInputs1[2]=new RecipeInputOreDict("dustGunpowder"); + recipeManager.addRecipe(new UniversalRecipeInput(null, dsmInputs1), new UniversalRecipeOutput(null,new ItemStack[] {output},1)); } public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) diff --git a/ihl/processing/metallurgy/DrawingDeskContainer.java b/ihl/processing/metallurgy/DrawingDeskContainer.java deleted file mode 100644 index ca570a1..0000000 --- a/ihl/processing/metallurgy/DrawingDeskContainer.java +++ /dev/null @@ -1,36 +0,0 @@ -package ihl.processing.metallurgy; - -import ic2.core.ContainerBase; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; - -public class DrawingDeskContainer extends ContainerBase { - - public DrawingDeskTileEntity tileEntity; - public int lastProgress = -1; - private final static int height=166; - - public DrawingDeskContainer(EntityPlayer entityPlayer, - DrawingDeskTileEntity tileEntity1) { - super(tileEntity1); - tileEntity=tileEntity1; - int col; - - for (col = 0; col < 3; ++col) - { - for (int col1 = 0; col1 < 9; ++col1) - { - this.addSlotToContainer(new Slot(entityPlayer.inventory, col1 + col * 9 + 9, 8 + col1 * 18, height + -82 + col * 18)); - } - } - - for (col = 0; col < 9; ++col) - { - this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); - } - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 8, 44)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.output, 0, 127, 44)); - } -} diff --git a/ihl/processing/metallurgy/DrawingDeskGui.java b/ihl/processing/metallurgy/DrawingDeskGui.java deleted file mode 100644 index 301e072..0000000 --- a/ihl/processing/metallurgy/DrawingDeskGui.java +++ /dev/null @@ -1,59 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import ic2.core.IC2; -import ic2.core.network.NetworkManager; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -public class DrawingDeskGui extends GuiContainer { - - private DrawingDeskContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIDrawingDesk.png"); - - public DrawingDeskGui(DrawingDeskContainer latheContainer) { - super(latheContainer); - container = latheContainer; - } - - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(tex); - int i1; - if (this.container.tileEntity.progress > 0) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.99F); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(38),38); - this.drawTexturedModalRect(68, 30, 176, 0, i1 + 1, 10); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, - int par3) { - //draw your Gui here, only thing you need to change is the path - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(tex); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - @Override - public void onGuiClosed() - { - super.onGuiClosed(); - this.container.tileEntity.isGuiScreenOpened=false; - IC2.network.get().initiateClientTileEntityEvent(this.container.tileEntity, 0); - } - -} diff --git a/ihl/processing/metallurgy/DrawingDeskModel.java b/ihl/processing/metallurgy/DrawingDeskModel.java deleted file mode 100644 index 55f1c84..0000000 --- a/ihl/processing/metallurgy/DrawingDeskModel.java +++ /dev/null @@ -1,66 +0,0 @@ -package ihl.processing.metallurgy; - -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; -import ihl.model.IHLModelRenderer; - -public class DrawingDeskModel extends ModelBase -{ - //fields - IHLModelRenderer RotatePart; - IHLModelRenderer Piece1; - - public DrawingDeskModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("RotatePart.Shape1", 0, 14); - setTextureOffset("RotatePart.Pipe2", 0, 17); - setTextureOffset("RotatePart.Shape4", 3, 14); - setTextureOffset("RotatePart.Shape3", 0, 26); - setTextureOffset("RotatePart.Pipe5", 16, 20); - setTextureOffset("RotatePart.Pipe6", 0, 18); - setTextureOffset("RotatePart.Pipe11", 13, 22); - setTextureOffset("RotatePart.Pipe12", 13, 22); - setTextureOffset("RotatePart.Pipe13", 13, 22); - setTextureOffset("RotatePart.Pipe14", 13, 22); - setTextureOffset("RotatePart.Pipe15", 13, 22); - setTextureOffset("Piece1.Shape7", 0, 17); - setTextureOffset("Piece1.Shape8", 0, 17); - setTextureOffset("Piece1.PipeW9", 0, 18); - setTextureOffset("Piece1.PipeW10", 0, 20); - setTextureOffset("Piece1.Shape2", 0, 0); - - RotatePart = new IHLModelRenderer(this, "RotatePart"); - RotatePart.setRotationPoint(0F, 23F, -6F); - setRotation(RotatePart, 0.4F, 0F, 0F); - RotatePart.mirror = true; - RotatePart.addBox("Shape1", 7F, -1F, -1F, 1, 2, 16,false); - RotatePart.addTube("Pipe2", -7.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addBox("Shape4", -8F, -1F, -1F, 1, 2, 16,false); - RotatePart.addBox("Shape3", -7F, -1F, -1F, 14, 2, 2,false); - RotatePart.addTube("Pipe5", -5.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe6", -3.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe11", -1.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe12", 0.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe13", 2.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe14", 4.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe15", 6.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - Piece1 = new IHLModelRenderer(this, "Piece1"); - Piece1.setRotationPoint(0F, 16F, 0F); - setRotation(Piece1, 0F, 0F, 0F); - Piece1.mirror = true; - Piece1.addBox("Shape7", 6F, -4F, 6F, 1, 12, 2,false); - Piece1.addBox("Shape8", -7F, -4F, 6F, 1, 12, 2,false); - Piece1.addTube("PipeW9", -6F, 7F, 7F, 12, 1, 1, 0F,1F,ForgeDirection.EAST); - Piece1.addTube("PipeW10", -6F, -4F, 6F, 12, 1, 1, 0F,1F,ForgeDirection.EAST); - Piece1.addBox("Shape2", 0F, 7F, 0F, 4, 1, 1,false); - } - - private void setRotation(IHLModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} 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; - } - -} diff --git a/ihl/processing/metallurgy/ElectricEngineItem.java b/ihl/processing/metallurgy/ElectricEngineItem.java index ec1bdf6..59d6d07 100644 --- a/ihl/processing/metallurgy/ElectricEngineItem.java +++ b/ihl/processing/metallurgy/ElectricEngineItem.java @@ -18,8 +18,8 @@ import ihl.IHLModInfo; public class ElectricEngineItem extends Item{ public Type type; - public static List instances = new ArrayList(); - private static Map iconMap = new HashMap(); + public static List instances = new ArrayList (); + private static Map iconMap = new HashMap(); public ElectricEngineItem(Type type1) diff --git a/ihl/processing/metallurgy/ExtruderContainer.java b/ihl/processing/metallurgy/ExtruderContainer.java index f4af0c0..77b92e6 100644 --- a/ihl/processing/metallurgy/ExtruderContainer.java +++ b/ihl/processing/metallurgy/ExtruderContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class ExtruderContainer extends ContainerBase { +public class ExtruderContainer extends ContainerBase { public ExtruderTileEntity tileEntity; public int lastProgress = -1; @@ -33,7 +33,7 @@ public class ExtruderContainer extends ContainerBase { } this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 0, 39, 32)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input2, 0, 57, 32)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 8, 32)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 8, 32)); } @Override diff --git a/ihl/processing/metallurgy/ExtruderGui.java b/ihl/processing/metallurgy/ExtruderGui.java index 1c10b89..acf1a76 100644 --- a/ihl/processing/metallurgy/ExtruderGui.java +++ b/ihl/processing/metallurgy/ExtruderGui.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; @@ -19,9 +18,6 @@ public class ExtruderGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(tex); int i1; @@ -38,11 +34,6 @@ public class ExtruderGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); this.drawTexturedModalRect(74, 34, 198, 0, i1 + 1, 13); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/metallurgy/ExtruderTileEntity.java b/ihl/processing/metallurgy/ExtruderTileEntity.java index de7a4c7..a654bfc 100644 --- a/ihl/processing/metallurgy/ExtruderTileEntity.java +++ b/ihl/processing/metallurgy/ExtruderTileEntity.java @@ -5,9 +5,7 @@ import java.util.List; import java.util.Map; import ic2.core.ContainerBase; -import ic2.core.IC2; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; @@ -30,7 +28,6 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ public final ApparatusProcessableInvSlot input; public final ApparatusProcessableInvSlot input2; - public boolean hasEngine; private int processTimer=0; private FluidTank fluidTank = new FluidTank(1000); protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("extruder"); @@ -40,7 +37,6 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ super(); input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64); input2 = new ApparatusProcessableInvSlot(this, "input2", 2, Access.IO, 1, 64); - isGuiScreenOpened=true; } @@ -48,9 +44,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ @Override public List getNetworkedFields() { - List fields = super.getNetworkedFields(); - fields.add("hasEngine"); - return fields; + return super.getNetworkedFields(); } @@ -63,16 +57,6 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ public void updateEntityServer() { super.updateEntityServer(); - if(this.engine.isEmpty() && hasEngine==true) - { - this.hasEngine=false; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - else if(this.engine.correctContent() && hasEngine==false) - { - this.hasEngine=true; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } ForgeDirection dir = ForgeDirection.getOrientation(getFacing()); TileEntity te = worldObj.getTileEntity(xCoord+dir.offsetX,yCoord+dir.offsetY,zCoord+dir.offsetZ); if(checkCorrectAccembly() && this.fluidTank.getFluidAmount()>0 && this.processTimer++>20) @@ -114,6 +98,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ return ExtruderTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { @@ -123,7 +108,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ @Override public boolean canOperate() { - return this.fluidTank.getFluidAmount() { protected GasWeldingStationTileEntity tileEntity; public short lastProgress2 = -1; diff --git a/ihl/processing/metallurgy/GasWeldingStationGui.java b/ihl/processing/metallurgy/GasWeldingStationGui.java index 7a34fa6..6248159 100644 --- a/ihl/processing/metallurgy/GasWeldingStationGui.java +++ b/ihl/processing/metallurgy/GasWeldingStationGui.java @@ -8,7 +8,6 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Slot; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import ic2.core.network.NetworkManager; import ihl.utils.IHLRenderUtils; @SideOnly(Side.CLIENT) diff --git a/ihl/processing/metallurgy/GasWeldingStationTileEntity.java b/ihl/processing/metallurgy/GasWeldingStationTileEntity.java index 764b524..ff15f5a 100644 --- a/ihl/processing/metallurgy/GasWeldingStationTileEntity.java +++ b/ihl/processing/metallurgy/GasWeldingStationTileEntity.java @@ -127,57 +127,6 @@ public class GasWeldingStationTileEntity extends TileEntityInventory implements return "detonationSprayingMachine"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - @Override @SideOnly(Side.CLIENT) public GuiScreen getGui(EntityPlayer player, boolean arg1) { @@ -225,12 +174,12 @@ public class GasWeldingStationTileEntity extends TileEntityInventory implements public UniversalRecipeInput getInput() { - return new UniversalRecipeInput(Arrays.asList(new FluidStack[] {this.flammableGasTank.getLigthestFluid(), this.oxygenTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get(0),this.input.get(1),this.input.get(2)})); + return new UniversalRecipeInput(new FluidStack[] {this.flammableGasTank.getLigthestFluid(), this.oxygenTank.getFluid()}, new ItemStack[]{this.input.get(0),this.input.get(1),this.input.get(2)}); } public static void addGasRecipe(ItemStack input, FluidStack inputFluid, FluidStack output, FluidStack output2) { - acetyleneRecipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {inputFluid}), Arrays.asList(new ItemStack[] {input})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {output, output2}),Arrays.asList(new ItemStack [] {}),20)); + acetyleneRecipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] {inputFluid},new ItemStack[] {input}), new UniversalRecipeOutput(new FluidStack [] {output, output2},new ItemStack [] {}, 20)); } public static Map getGasRecipes() { diff --git a/ihl/processing/metallurgy/ImpregnatingMachineContainer.java b/ihl/processing/metallurgy/ImpregnatingMachineContainer.java index 4489af2..2a95dcb 100644 --- a/ihl/processing/metallurgy/ImpregnatingMachineContainer.java +++ b/ihl/processing/metallurgy/ImpregnatingMachineContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class ImpregnatingMachineContainer extends ContainerBase { +public class ImpregnatingMachineContainer extends ContainerBase { protected ImpregnatingMachineTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java index 89a8a63..2ea5d2e 100644 --- a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java +++ b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java @@ -25,7 +25,6 @@ import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlot.Access; import ic2.core.block.invslot.InvSlotConsumableLiquid; import ic2.core.block.invslot.InvSlotOutput; -import ic2.core.network.NetworkManager; import ihl.interfaces.IHasTemperature; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.processing.chemistry.ChemicalReactorTileEntity; @@ -125,7 +124,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement } temperature=(short) (this.fluidTank.getTemperature()-273); IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - boolean needsInvUpdate = false; if (this.canOperate()) { this.setActive(true); @@ -138,7 +136,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement if (this.progress >= this.operationLength) { this.operate(); - needsInvUpdate = true; this.progress = 0; IC2.network.get().initiateTileEntityEvent(this, 2, true); } @@ -181,57 +178,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement return "impregnatingMachine"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - public float getRenderLiquidLevel() { return (float)this.visibleFluidAmount/(float)this.fluidTank.getCapacity(); @@ -273,6 +219,7 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement return ImpregnatingMachineTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings("rawtypes") public List[] getInput() { for(int i=0;i resultList = OreDictionary.getOres(this.resultSuffix+formattedFluidName); - if(resultList.isEmpty()) + if(resultList.isEmpty() || fluidAmountPerItem<=0) { - resultList=new ArrayList(); - if(IHLUtils.getItemStackIfExist(this.resultSuffix+formattedFluidName)!=null)resultList.add(IHLUtils.getItemStackIfExist(this.resultSuffix+formattedFluidName)); +// IHLMod.log.info("Injection mold: resultList.isEmpty() || fluidAmountPerItem<=0"); + resultList=new ArrayList(); + List fi = Arrays.asList(new FluidStack[] {this.fluidTank.getFluid()}); + List ii = Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithDamage("injectionMold", this.resultSuffix.hashCode() & Integer.MAX_VALUE)}); + UniversalRecipeOutput ro = recipeManager.getOutputFor(fi, ii, false, false); + if(ro!=null) + { + // IHLMod.log.info("Injection mold: ro not null"); + ItemStack stack = ro.getItemOutputs().get(0).itemStack.copy(); + stack.stackSize=Math.round(ro.getItemOutputs().get(0).quantity); + resultList.add(stack); + UniversalRecipeInput ri = recipeManager.getRecipeInput(fi, ii); + fluidAmountPerItem = ri.getFluidInputs().get(0).getAmount(); + // IHLMod.log.info("fluidAmountPerItem="+fluidAmountPerItem); + } + else + { + // IHLMod.log.info("Injection mold: ro is null. Input stack: "+ii.get(0).toString()); + } } + int fluidAmountPerItem2 = Details.getMeltingFluidAmount("nugget"); ArrayList resultList2 = OreDictionary.getOres("nugget"+formattedFluidName); if(!resultList.isEmpty()) { @@ -132,10 +150,6 @@ public class InjectionMoldTileEntity extends TileEntity implements IFluidHandler private String getFormattedMaterialName(String input) { - if(input.length()<8) - { - return ""; - } String input2 = input.replace("molten.", "").replace(".molten", ""); String firstletter = String.valueOf(input2.charAt(0)).toUpperCase(); input2 = input2.replaceFirst(".", firstletter); diff --git a/ihl/processing/metallurgy/LatheContainer.java b/ihl/processing/metallurgy/LatheContainer.java index c863f7b..5e79a2a 100644 --- a/ihl/processing/metallurgy/LatheContainer.java +++ b/ihl/processing/metallurgy/LatheContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class LatheContainer extends ContainerBase { +public class LatheContainer extends ContainerBase { public LathePart1TileEntity tileEntity; public int lastProgress = -1; @@ -30,7 +30,7 @@ public class LatheContainer extends ContainerBase { { this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); } - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); } @Override diff --git a/ihl/processing/metallurgy/LatheGui.java b/ihl/processing/metallurgy/LatheGui.java index e09f414..16f64c5 100644 --- a/ihl/processing/metallurgy/LatheGui.java +++ b/ihl/processing/metallurgy/LatheGui.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; @@ -20,9 +19,6 @@ public class LatheGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); fontRendererObj.drawString(StatCollector.translateToLocal("ihl.gui.lathe"), 50, 10, 14722081); this.mc.renderEngine.bindTexture(tex); @@ -40,11 +36,6 @@ public class LatheGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/metallurgy/LathePart1TileEntity.java b/ihl/processing/metallurgy/LathePart1TileEntity.java index 9241ba1..ddf834b 100644 --- a/ihl/processing/metallurgy/LathePart1TileEntity.java +++ b/ihl/processing/metallurgy/LathePart1TileEntity.java @@ -19,7 +19,6 @@ public class LathePart1TileEntity extends BasicElectricMotorTileEntity implement public LathePart1TileEntity() { super(); - this.isGuiScreenOpened=true; } @@ -52,6 +51,7 @@ public class LathePart1TileEntity extends BasicElectricMotorTileEntity implement } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { diff --git a/ihl/processing/metallurgy/LathePart2TileEntity.java b/ihl/processing/metallurgy/LathePart2TileEntity.java index 4543afa..7d4dac7 100644 --- a/ihl/processing/metallurgy/LathePart2TileEntity.java +++ b/ihl/processing/metallurgy/LathePart2TileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/ihl/processing/metallurgy/MachineBaseTileEntity.java b/ihl/processing/metallurgy/MachineBaseTileEntity.java index 51df187..de20f5a 100644 --- a/ihl/processing/metallurgy/MachineBaseTileEntity.java +++ b/ihl/processing/metallurgy/MachineBaseTileEntity.java @@ -6,10 +6,8 @@ import ic2.api.energy.tile.IEnergySink; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.IHasGui; -import ic2.core.audio.AudioSource; import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.recipes.UniversalRecipeOutput; import java.util.List; @@ -26,9 +24,6 @@ public abstract class MachineBaseTileEntity extends TileEntityInventory implemen { public short progress; protected short operationLength=200; - private AudioSource startAS; - private AudioSource loopAS; - private AudioSource stopAS; protected double energy; public int maxStorage; public int energyConsume; @@ -222,6 +217,7 @@ public abstract class MachineBaseTileEntity extends TileEntityInventory implemen public abstract UniversalRecipeOutput getOutput(); + @SuppressWarnings("rawtypes") public List[] getInput() { return new List[]{null, this.input.getItemStackList()}; diff --git a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java index 73d12de..c5a54c7 100644 --- a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java +++ b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java @@ -110,7 +110,7 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity{ public static void addRecipe(ItemStack input1, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input1})),new UniversalRecipeOutput(null, Arrays.asList(new ItemStack [] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input1})),new UniversalRecipeOutput(null, (new ItemStack [] {output}),20)); } @@ -130,6 +130,6 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity{ } public static void addRecipe(ItemStack input1, ItemStack output, float f) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input1})),new UniversalRecipeOutput(null, Arrays.asList(new RecipeOutputItemStack [] {new RecipeOutputItemStack(output,f)}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input1})),new UniversalRecipeOutput(null, (new RecipeOutputItemStack [] {new RecipeOutputItemStack(output,f)}),20)); } } diff --git a/ihl/processing/metallurgy/RollingMachineContainer.java b/ihl/processing/metallurgy/RollingMachineContainer.java index c3bdb31..7a83d9d 100644 --- a/ihl/processing/metallurgy/RollingMachineContainer.java +++ b/ihl/processing/metallurgy/RollingMachineContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class RollingMachineContainer extends ContainerBase { +public class RollingMachineContainer extends ContainerBase { public RollingMachinePart1TileEntity tileEntity; public int lastProgress = -1; @@ -33,7 +33,7 @@ public class RollingMachineContainer extends ContainerBase { } this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 0, 54, 25)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 105, 25)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); } @Override diff --git a/ihl/processing/metallurgy/RollingMachineGui.java b/ihl/processing/metallurgy/RollingMachineGui.java index 16ccdac..a792bd3 100644 --- a/ihl/processing/metallurgy/RollingMachineGui.java +++ b/ihl/processing/metallurgy/RollingMachineGui.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; @@ -19,9 +18,6 @@ public class RollingMachineGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(tex); int i1; @@ -39,11 +35,6 @@ public class RollingMachineGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java index 9c02a47..a3d6ae6 100644 --- a/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java +++ b/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java @@ -7,7 +7,6 @@ import java.util.Map; import ic2.core.ContainerBase; import ic2.core.IC2; 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.RecipeOutputItemStack; @@ -27,7 +26,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ public final ApparatusProcessableInvSlot input; public final IHLInvSlotOutput output; - public boolean hasEngine; public boolean assembled; protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("rollingmachine"); @@ -36,7 +34,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ super(); input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64); output = new IHLInvSlotOutput(this, "output", 2, 1); - isGuiScreenOpened=true; } public UniversalRecipeOutput getOutput() @@ -49,7 +46,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ { List fields = super.getNetworkedFields(); fields.add("assembled"); - fields.add("hasEngine"); return fields; } @@ -73,17 +69,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ assembled=true; IC2.network.get().updateTileEntityField(this, "assembled"); } - if(this.engine.isEmpty() && hasEngine==true) - { - this.hasEngine=false; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - else if(this.engine.correctContent() && hasEngine==false) - { - this.hasEngine=true; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - if (this.getActive() && this.progress == 0 && !this.canOperate()) { this.setActive(false); @@ -121,6 +106,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ this.input.consume(0, 1); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { @@ -130,7 +116,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ @Override public boolean canOperate() { - return this.engine.correctContent() && this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); + return this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); } private boolean checkCorrectAccembly() @@ -144,7 +130,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ public static void addRecipe(ItemStack input, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}), 20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input})), new UniversalRecipeOutput(null, (new ItemStack[] {output}), 20)); } diff --git a/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java b/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java index 6bab8c4..13f4f6c 100644 --- a/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java +++ b/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/ihl/processing/metallurgy/RollingMachineRender.java b/ihl/processing/metallurgy/RollingMachineRender.java index ee8b567..1990769 100644 --- a/ihl/processing/metallurgy/RollingMachineRender.java +++ b/ihl/processing/metallurgy/RollingMachineRender.java @@ -72,11 +72,8 @@ private final float scale=1F/16F; model.RotatingPart1.render(scale); model.RotatingPart2.render(scale); } - if(cte.hasEngine) - { - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - } + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); } GL11.glPopMatrix(); //end diff --git a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java index 8b9ea9e..2f22a4d 100644 --- a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java +++ b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java @@ -1,7 +1,6 @@ package ihl.processing.metallurgy; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.collector.GuiMultiTextureButton; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; @@ -22,6 +21,7 @@ public class VacuumInductionMeltingFurnaceGui extends GuiContainer { this.container=vacuumInductionMeltingFurnaceContainer; } + @SuppressWarnings("unchecked") @Override public void initGui() { @@ -46,8 +46,6 @@ public class VacuumInductionMeltingFurnaceGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); fontRendererObj.drawString(StatCollector.translateToLocal("ihl.gui.muffleFurnace"), 40, 12, 14722081); this.mc.renderEngine.bindTexture(background); diff --git a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java index 3fc85a8..e2867bc 100644 --- a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java +++ b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java @@ -4,14 +4,13 @@ import java.util.Arrays; import java.util.Map; import ic2.api.network.INetworkClientTileEntityEventListener; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputOreDict; import ic2.core.ContainerBase; -import ihl.IHLMod; import ihl.processing.chemistry.GaedesMercuryRotaryPumpTileEntity; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; import ihl.recipes.UniversalRecipeOutput; -import ihl.tunneling_shield.IMultiBlock; -import ihl.tunneling_shield.MultiBlockSpacerBlock; import ihl.utils.IHLFluidTank; import ihl.utils.IHLUtils; import net.minecraft.client.gui.GuiScreen; @@ -24,13 +23,12 @@ import net.minecraftforge.fluids.FluidStack; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEntity implements INetworkClientTileEntityEventListener, IMultiBlock{ +public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEntity implements INetworkClientTileEntityEventListener{ protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("vacuuminductionmeltingfurnace"); public final IHLFluidTank fluidTank = new IHLFluidTank(864); public boolean vacuumPumpConnected=false; private GaedesMercuryRotaryPumpTileEntity lastGMRP; - private int minX,minY,minZ,maxX,maxY,maxZ; public VacuumInductionMeltingFurnaceTileEntity() { @@ -42,27 +40,6 @@ public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEnti { short facing2 = (short) Math.max(facing1, 2); super.setFacing(facing2); - switch(facing2) - { - case 0: - setupMultiblockStructure(-1,-2,0); - break; - case 1: - setupMultiblockStructure(-1,0,0); - break; - case 2: - setupMultiblockStructure(-1,0,-2); - break; - case 3: - setupMultiblockStructure(-1,0,0); - break; - case 4: - setupMultiblockStructure(-2,0,-1); - break; - case 5: - setupMultiblockStructure(0,0,-1); - break; - } } @Override @@ -159,9 +136,9 @@ public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEnti return IHLUtils.getThisModItemStack("vacuumInductionMeltingFurnace"); } - public static void addRecipe(ItemStack input, FluidStack output) + public static void addRecipe(String input, int amount, String input2, int amount2, FluidStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input})),new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output}),null,20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput [] {new RecipeInputOreDict(input,amount),new RecipeInputOreDict(input2,amount2)})),new UniversalRecipeOutput((new FluidStack[] {output}),null,20)); } @@ -220,41 +197,4 @@ public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEnti this.fluidTank.writeToNBT(fluidTankTag); nbttagcompound.setTag("fluidTank", fluidTankTag); } - - private void setupMultiblockStructure(int x0,int y0,int z0) - { - minX=xCoord+x0; - maxX=xCoord+x0+3; - minY=yCoord+y0; - maxY=yCoord+y0+3; - minZ=zCoord+z0; - maxZ=zCoord+z0+3; - for(int ix=xCoord+x0;ix=minX && x<=maxX && y>=minY && y<=maxY && z>=minZ && z<=maxZ; - } - - @Override - public boolean getIsInvalid() - { - return this.isInvalid(); - } - } diff --git a/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java b/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java index 6feca57..40d44e4 100644 --- a/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java +++ b/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java @@ -11,7 +11,6 @@ import ic2.api.energy.tile.IEnergySink; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.items_blocks.FlexibleCableItem; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; @@ -47,7 +46,7 @@ public class VulcanizationExtrudingMoldTileEntity extends TileEntity implements public static void addRecipe(FluidStack inputFluid,ItemStack input,ItemStack output1) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {inputFluid}),Arrays.asList(new ItemStack[] {input})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output1}),200)); + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {inputFluid}),(new ItemStack[] {input})),new UniversalRecipeOutput(null,(new ItemStack[] {output1}),200)); } public boolean enableUpdateEntity() diff --git a/ihl/processing/metallurgy/WireMillContainer.java b/ihl/processing/metallurgy/WireMillContainer.java index ec1ddc0..34f79de 100644 --- a/ihl/processing/metallurgy/WireMillContainer.java +++ b/ihl/processing/metallurgy/WireMillContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class WireMillContainer extends ContainerBase { +public class WireMillContainer extends ContainerBase { public WireMillTileEntity tileEntity; public int lastProgress = -1; @@ -51,7 +51,7 @@ public class WireMillContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity.drainInputSlot, 0, 26+18, 14)); this.addSlotToContainer(new SlotInvSlot(tileEntity.fillInputSlot, 0, 26+18, 50)); this.addSlotToContainer(new SlotInvSlot(tileEntity.emptyFluidItemsSlot, 0, 26+18, 32)); - this.addSlotToContainer(new SlotInvSlot(tileEntity.engine,0, 8, 14)); + this.addSlotToContainer(new SlotInvSlot(tileEntity.dischargeSlot,0, 8, 14)); } @Override diff --git a/ihl/processing/metallurgy/WireMillGui.java b/ihl/processing/metallurgy/WireMillGui.java index e09b4ab..8a3d583 100644 --- a/ihl/processing/metallurgy/WireMillGui.java +++ b/ihl/processing/metallurgy/WireMillGui.java @@ -52,10 +52,6 @@ public class WireMillGui extends GuiContainer { } this.mc.renderEngine.bindTexture(tex); - if(!this.container.tileEntity.engine.correctContent()) - { - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 25, 14, xOffset, yOffset); - } IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.wiremill.tip")); } diff --git a/ihl/processing/metallurgy/WireMillTileEntity.java b/ihl/processing/metallurgy/WireMillTileEntity.java index 16eaa4b..4216960 100644 --- a/ihl/processing/metallurgy/WireMillTileEntity.java +++ b/ihl/processing/metallurgy/WireMillTileEntity.java @@ -4,17 +4,13 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import org.apache.commons.lang3.mutable.MutableObject; - import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.core.ContainerBase; import ic2.core.block.invslot.InvSlot; -import ic2.core.block.invslot.InvSlotConsumableItemStack; import ic2.core.block.invslot.InvSlotConsumableLiquid; import ic2.core.block.invslot.InvSlotOutput; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.block.invslot.InvSlot.InvSide; import ihl.IHLMod; import ihl.items_blocks.IHLTool; import ihl.processing.chemistry.ApparatusProcessableInvSlot; @@ -23,7 +19,6 @@ import ihl.recipes.IRecipeInputFluid; import ihl.recipes.RecipeInputDie; import ihl.recipes.RecipeInputFluidDictionary; import ihl.recipes.RecipeInputFluidStack; -import ihl.recipes.RecipeOutputItemStack; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; import ihl.recipes.UniversalRecipeOutput; @@ -36,7 +31,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; @@ -62,7 +56,6 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); drainInputSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Drain, "ingot"); dice = new ApparatusProcessableInvSlot(this, "dice", 3, Access.IO, 1, 64); - this.isGuiScreenOpened=true; this.operationLength=600; } @@ -142,7 +135,6 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements { this.metalFluidTank.fill(rOutput.getFluidOutputs().get(0), true); } - ForgeDirection dir = ForgeDirection.getOrientation(getFacing()).getRotation(ForgeDirection.DOWN); TileEntity te = worldObj.getTileEntity(xCoord+ForgeDirection.getOrientation(getFacing()).offsetX,yCoord+ForgeDirection.getOrientation(getFacing()).offsetY,zCoord+ForgeDirection.getOrientation(getFacing()).offsetZ); if(rOutputItemStack!=null && te instanceof IProductionLine) { @@ -156,6 +148,7 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements } } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { @@ -169,12 +162,12 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements public static void addRecipe(FluidStack moltenMetal, IRecipeInput inputDice,ItemStack output1) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new IRecipeInputFluid[] {new RecipeInputFluidDictionary("lubricant", 1),new RecipeInputFluidDictionary("water", 1),new RecipeInputFluidStack(moltenMetal)}),Arrays.asList(new IRecipeInput[] {inputDice})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output1}),200)); + recipeManager.addRecipe(new UniversalRecipeInput((new IRecipeInputFluid[] {new RecipeInputFluidDictionary("lubricant", 1),new RecipeInputFluidDictionary("water", 1),new RecipeInputFluidStack(moltenMetal)}),(new IRecipeInput[] {inputDice})),new UniversalRecipeOutput(null,(new ItemStack[] {output1}),200)); } public static void addRecipe(String string, FluidStack fluidStack) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new IRecipeInput [] {new RecipeInputOreDict(string)})),new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStack}),null,200)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput [] {new RecipeInputOreDict(string)})),new UniversalRecipeOutput((new FluidStack[] {fluidStack}),null,200)); } diff --git a/ihl/processing/metallurgy/WoodenRollingMachineContainer.java b/ihl/processing/metallurgy/WoodenRollingMachineContainer.java index 100da1b..ba191f8 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachineContainer.java +++ b/ihl/processing/metallurgy/WoodenRollingMachineContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class WoodenRollingMachineContainer extends ContainerBase { +public class WoodenRollingMachineContainer extends ContainerBase { public WoodenRollingMachinePart1TileEntity tileEntity; public int lastProgress = -1; @@ -35,7 +35,7 @@ public class WoodenRollingMachineContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 0, 123, 15)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 1, 123, 34)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 2, 123, 53)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); } @Override diff --git a/ihl/processing/metallurgy/WoodenRollingMachineGui.java b/ihl/processing/metallurgy/WoodenRollingMachineGui.java index d7b3456..085dae5 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachineGui.java +++ b/ihl/processing/metallurgy/WoodenRollingMachineGui.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; @@ -19,9 +18,6 @@ public class WoodenRollingMachineGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(tex); int i1; @@ -39,11 +35,6 @@ public class WoodenRollingMachineGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); this.drawTexturedModalRect(18, 22, getFrameX(i1), getFrameY(i1),24,24); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java index eb40389..31b6386 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java +++ b/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java @@ -1,6 +1,5 @@ package ihl.processing.metallurgy; -import java.util.Arrays; import java.util.List; import java.util.Map; @@ -8,7 +7,6 @@ import ic2.api.recipe.IRecipeInput; import ic2.core.ContainerBase; import ic2.core.IC2; 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.RecipeOutputItemStack; @@ -28,7 +26,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE public final ApparatusProcessableInvSlot input; public final IHLInvSlotOutput output; - public boolean hasEngine; public boolean assembled; protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("woodenrollingmachine"); @@ -37,7 +34,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE super(); input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 3, 64); output = new IHLInvSlotOutput(this, "output", 2, 1); - isGuiScreenOpened=true; } public UniversalRecipeOutput getOutput() @@ -50,7 +46,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE { List fields = super.getNetworkedFields(); fields.add("assembled"); - fields.add("hasEngine"); return fields; } @@ -74,17 +69,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE assembled=true; IC2.network.get().updateTileEntityField(this, "assembled"); } - if(this.engine.isEmpty() && hasEngine==true) - { - this.hasEngine=false; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - else if(this.engine.correctContent() && hasEngine==false) - { - this.hasEngine=true; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - if (this.getActive() && this.progress == 0 && !this.canOperate()) { this.setActive(false); @@ -126,6 +110,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE } } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { @@ -135,7 +120,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE @Override public boolean canOperate() { - return this.engine.correctContent() && this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); + return this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); } private boolean checkCorrectAccembly() @@ -149,7 +134,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE public static void addRecipe(ItemStack input, ItemStack input2, ItemStack input3, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input,input2,input3})), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input,input2,input3})), new UniversalRecipeOutput(null,(new ItemStack[] {output}),20)); } @@ -159,7 +144,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE public static void addRecipe(ItemStack input, ItemStack input3, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input,input3})), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input,input3})), new UniversalRecipeOutput(null,(new ItemStack[] {output}),20)); } @Override diff --git a/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java b/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java index 165d84b..9aec41b 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java +++ b/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/ihl/processing/metallurgy/WoodenRollingMachineRender.java b/ihl/processing/metallurgy/WoodenRollingMachineRender.java index 84fbcd6..f5fd12a 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachineRender.java +++ b/ihl/processing/metallurgy/WoodenRollingMachineRender.java @@ -80,13 +80,10 @@ private final float scale=1F/16F; model.RotatingPart3.render(scale); model.RotatingPart4.render(scale); } - if(cte.hasEngine) - { - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - model.Belt1.render(scale); - model.Belt2.render(scale); - } + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); + model.Belt1.render(scale); + model.Belt2.render(scale); } GL11.glPopMatrix(); //end -- cgit v1.2.3