From dc3df3edd5843bde0c1335d6a8e460b2c832aa48 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Sat, 17 Jun 2017 08:12:18 +0300 Subject: full project files --- .../chemistry/ApparatusProcessableInvSlot.java | 59 --- .../chemistry/BasicElectricMotorContainer.java | 74 ---- ihl/processing/chemistry/BatteryItem.java | 194 ---------- .../chemistry/ChemicalReactorContainer.java | 40 -- ihl/processing/chemistry/ChemicalReactorGui.java | 79 ---- .../chemistry/ChemicalReactorTileEntity.java | 294 -------------- .../chemistry/CryogenicDistillerContainer.java | 39 -- .../chemistry/CryogenicDistillerGui.java | 71 ---- .../chemistry/CryogenicDistillerTileEntity.java | 211 ---------- ihl/processing/chemistry/DosingPumpContainer.java | 95 ----- ihl/processing/chemistry/DosingPumpGui.java | 103 ----- ihl/processing/chemistry/DosingPumpTileEntity.java | 226 ----------- .../chemistry/ElectricEvaporatorBlock.java | 220 ----------- .../chemistry/ElectricEvaporatorContainer.java | 113 ------ .../chemistry/ElectricEvaporatorGui.java | 85 ---- .../chemistry/ElectricEvaporatorTileEntity.java | 430 --------------------- .../chemistry/ElectrolysisBathContainer.java | 86 ----- ihl/processing/chemistry/ElectrolysisBathGui.java | 100 ----- .../chemistry/ElectrolysisBathModel.java | 86 ----- .../chemistry/ElectrolysisBathTileEntity.java | 297 -------------- ihl/processing/chemistry/EvaporatorBlock.java | 221 ----------- ihl/processing/chemistry/EvaporatorContainer.java | 100 ----- ihl/processing/chemistry/EvaporatorGui.java | 84 ---- ihl/processing/chemistry/EvaporatorTileEntity.java | 290 -------------- ihl/processing/chemistry/ExtruderModel.java | 100 ----- .../chemistry/FluidizedBedReactorContainer.java | 44 --- .../chemistry/FluidizedBedReactorGui.java | 59 --- .../chemistry/FluidizedBedReactorTileEntity.java | 312 --------------- .../chemistry/FractionatorBottomModel.java | 48 --- .../chemistry/FractionatorBottomTileEntity.java | 352 ----------------- .../chemistry/FractionatorCoverModel.java | 52 --- .../chemistry/FractionatorCoverTileEntity.java | 104 ----- .../chemistry/FractionatorSectionModel.java | 47 --- .../chemistry/FractionatorSectionTileEntity.java | 148 ------- .../GaedesMercuryRotaryPumpContainer.java | 76 ---- .../chemistry/GaedesMercuryRotaryPumpGui.java | 60 --- .../chemistry/GaedesMercuryRotaryPumpModel.java | 64 --- .../GaedesMercuryRotaryPumpTileEntity.java | 83 ---- .../chemistry/LabElectrolyzerContainer.java | 73 ---- ihl/processing/chemistry/LabElectrolyzerGui.java | 74 ---- .../chemistry/LabElectrolyzerTileEntity.java | 272 ------------- ihl/processing/chemistry/LeadOvenContainer.java | 95 ----- ihl/processing/chemistry/LeadOvenGui.java | 55 --- ihl/processing/chemistry/LeadOvenTileEntity.java | 286 -------------- ihl/processing/chemistry/LoomContainer.java | 66 ---- ihl/processing/chemistry/LoomGui.java | 60 --- ihl/processing/chemistry/LoomModel.java | 66 ---- ihl/processing/chemistry/LoomTileEntity.java | 172 --------- .../chemistry/PaperMachineContainer.java | 41 -- ihl/processing/chemistry/PaperMachineGui.java | 79 ---- .../chemistry/PaperMachineTileEntity.java | 261 ------------- ihl/processing/chemistry/RefluxCondenserModel.java | 70 ---- .../chemistry/RefluxCondenserTileEntity.java | 148 ------- .../chemistry/SolarEvaporatorContainer.java | 112 ------ ihl/processing/chemistry/SolarEvaporatorGui.java | 78 ---- .../chemistry/SolarEvaporatorTileEntity.java | 108 ------ ihl/processing/invslots/IHLInvSlotOutput.java | 166 -------- .../invslots/InvSlotConsumableLiquidIHL.java | 271 ------------- ihl/processing/invslots/InvSlotUpgradeIHL.java | 61 --- .../invslots/SlotInvSlotIronWorkbench.java | 32 -- .../invslots/SlotInvSlotOutputInProgress.java | 23 -- ihl/processing/metallurgy/AchesonFurnaceGui.java | 46 --- .../metallurgy/AchesonFurnanceContainer.java | 16 - .../metallurgy/AchesonFurnanceTileEntity.java | 101 ----- .../metallurgy/BasicElectricMotorTileEntity.java | 272 ------------- ihl/processing/metallurgy/CoilerContainer.java | 65 ---- ihl/processing/metallurgy/CoilerGui.java | 48 --- ihl/processing/metallurgy/CoilerModel.java | 103 ----- ihl/processing/metallurgy/CoilerRender.java | 80 ---- ihl/processing/metallurgy/CoilerTileEntity.java | 155 -------- ihl/processing/metallurgy/Crucible.java | 366 ------------------ ihl/processing/metallurgy/CrucibleContainer.java | 66 ---- ihl/processing/metallurgy/CrucibleGui.java | 84 ---- ihl/processing/metallurgy/CrucibleInventory.java | 126 ------ ihl/processing/metallurgy/CrucibleSlot.java | 18 - .../DetonationSprayingMachineContainer.java | 39 -- .../metallurgy/DetonationSprayingMachineGui.java | 48 --- .../metallurgy/DetonationSprayingMachineModel.java | 57 --- .../DetonationSprayingMachineRender.java | 61 --- .../DetonationSprayingMachineTileEntity.java | 198 ---------- ihl/processing/metallurgy/ElectricEngineItem.java | 84 ---- ihl/processing/metallurgy/ExtruderContainer.java | 75 ---- ihl/processing/metallurgy/ExtruderGui.java | 49 --- ihl/processing/metallurgy/ExtruderModel.java | 100 ----- ihl/processing/metallurgy/ExtruderTileEntity.java | 155 -------- .../metallurgy/GasWeldingStationContainer.java | 99 ----- .../metallurgy/GasWeldingStationGui.java | 78 ---- .../metallurgy/GasWeldingStationModel.java | 108 ------ .../metallurgy/GasWeldingStationTileEntity.java | 286 -------------- ihl/processing/metallurgy/IProductionLine.java | 12 - .../metallurgy/ImpregnatingMachineContainer.java | 114 ------ .../metallurgy/ImpregnatingMachineGui.java | 63 --- .../metallurgy/ImpregnatingMachineRender.java | 55 --- .../metallurgy/ImpregnatingMachineTileEntity.java | 343 ---------------- ihl/processing/metallurgy/InjectionMoldBlock.java | 248 ------------ .../metallurgy/InjectionMoldTileEntity.java | 201 ---------- ihl/processing/metallurgy/LatheContainer.java | 72 ---- ihl/processing/metallurgy/LatheGui.java | 51 --- ihl/processing/metallurgy/LathePart1Model.java | 93 ----- .../metallurgy/LathePart1TileEntity.java | 99 ----- ihl/processing/metallurgy/LathePart2Model.java | 87 ----- .../metallurgy/LathePart2TileEntity.java | 104 ----- .../metallurgy/MachineBaseContainer.java | 74 ---- .../metallurgy/MachineBaseTileEntity.java | 279 ------------- ihl/processing/metallurgy/MuffleFurnaceGui.java | 48 --- .../metallurgy/MuffleFurnanceContainer.java | 16 - .../metallurgy/MuffleFurnanceTileEntity.java | 119 ------ .../metallurgy/RollingMachineContainer.java | 75 ---- ihl/processing/metallurgy/RollingMachineGui.java | 50 --- .../metallurgy/RollingMachinePart1Model.java | 97 ----- .../metallurgy/RollingMachinePart1TileEntity.java | 149 ------- .../metallurgy/RollingMachinePart2Model.java | 42 -- .../metallurgy/RollingMachinePart2TileEntity.java | 104 ----- .../metallurgy/RollingMachineRender.java | 81 ---- .../VulcanizationExtrudingMoldModel.java | 54 --- .../VulcanizationExtrudingMoldTileEntity.java | 256 ------------ ihl/processing/metallurgy/WireMillContainer.java | 113 ------ ihl/processing/metallurgy/WireMillGui.java | 68 ---- ihl/processing/metallurgy/WireMillTileEntity.java | 378 ------------------ .../metallurgy/WoodenRollingMachineContainer.java | 77 ---- .../metallurgy/WoodenRollingMachineGui.java | 60 --- .../metallurgy/WoodenRollingMachinePart1Model.java | 122 ------ .../WoodenRollingMachinePart1TileEntity.java | 158 -------- .../metallurgy/WoodenRollingMachinePart2Model.java | 44 --- .../WoodenRollingMachinePart2TileEntity.java | 104 ----- .../metallurgy/WoodenRollingMachineRender.java | 91 ----- 126 files changed, 14999 deletions(-) delete mode 100644 ihl/processing/chemistry/ApparatusProcessableInvSlot.java delete mode 100644 ihl/processing/chemistry/BasicElectricMotorContainer.java delete mode 100644 ihl/processing/chemistry/BatteryItem.java delete mode 100644 ihl/processing/chemistry/ChemicalReactorContainer.java delete mode 100644 ihl/processing/chemistry/ChemicalReactorGui.java delete mode 100644 ihl/processing/chemistry/ChemicalReactorTileEntity.java delete mode 100644 ihl/processing/chemistry/CryogenicDistillerContainer.java delete mode 100644 ihl/processing/chemistry/CryogenicDistillerGui.java delete mode 100644 ihl/processing/chemistry/CryogenicDistillerTileEntity.java delete mode 100644 ihl/processing/chemistry/DosingPumpContainer.java delete mode 100644 ihl/processing/chemistry/DosingPumpGui.java delete mode 100644 ihl/processing/chemistry/DosingPumpTileEntity.java delete mode 100644 ihl/processing/chemistry/ElectricEvaporatorBlock.java delete mode 100644 ihl/processing/chemistry/ElectricEvaporatorContainer.java delete mode 100644 ihl/processing/chemistry/ElectricEvaporatorGui.java delete mode 100644 ihl/processing/chemistry/ElectricEvaporatorTileEntity.java delete mode 100644 ihl/processing/chemistry/ElectrolysisBathContainer.java delete mode 100644 ihl/processing/chemistry/ElectrolysisBathGui.java delete mode 100644 ihl/processing/chemistry/ElectrolysisBathModel.java delete mode 100644 ihl/processing/chemistry/ElectrolysisBathTileEntity.java delete mode 100644 ihl/processing/chemistry/EvaporatorBlock.java delete mode 100644 ihl/processing/chemistry/EvaporatorContainer.java delete mode 100644 ihl/processing/chemistry/EvaporatorGui.java delete mode 100644 ihl/processing/chemistry/EvaporatorTileEntity.java delete mode 100644 ihl/processing/chemistry/ExtruderModel.java delete mode 100644 ihl/processing/chemistry/FluidizedBedReactorContainer.java delete mode 100644 ihl/processing/chemistry/FluidizedBedReactorGui.java delete mode 100644 ihl/processing/chemistry/FluidizedBedReactorTileEntity.java delete mode 100644 ihl/processing/chemistry/FractionatorBottomModel.java delete mode 100644 ihl/processing/chemistry/FractionatorBottomTileEntity.java delete mode 100644 ihl/processing/chemistry/FractionatorCoverModel.java delete mode 100644 ihl/processing/chemistry/FractionatorCoverTileEntity.java delete mode 100644 ihl/processing/chemistry/FractionatorSectionModel.java delete mode 100644 ihl/processing/chemistry/FractionatorSectionTileEntity.java delete mode 100644 ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java delete mode 100644 ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java delete mode 100644 ihl/processing/chemistry/GaedesMercuryRotaryPumpModel.java delete mode 100644 ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java delete mode 100644 ihl/processing/chemistry/LabElectrolyzerContainer.java delete mode 100644 ihl/processing/chemistry/LabElectrolyzerGui.java delete mode 100644 ihl/processing/chemistry/LabElectrolyzerTileEntity.java delete mode 100644 ihl/processing/chemistry/LeadOvenContainer.java delete mode 100644 ihl/processing/chemistry/LeadOvenGui.java delete mode 100644 ihl/processing/chemistry/LeadOvenTileEntity.java delete mode 100644 ihl/processing/chemistry/LoomContainer.java delete mode 100644 ihl/processing/chemistry/LoomGui.java delete mode 100644 ihl/processing/chemistry/LoomModel.java delete mode 100644 ihl/processing/chemistry/LoomTileEntity.java delete mode 100644 ihl/processing/chemistry/PaperMachineContainer.java delete mode 100644 ihl/processing/chemistry/PaperMachineGui.java delete mode 100644 ihl/processing/chemistry/PaperMachineTileEntity.java delete mode 100644 ihl/processing/chemistry/RefluxCondenserModel.java delete mode 100644 ihl/processing/chemistry/RefluxCondenserTileEntity.java delete mode 100644 ihl/processing/chemistry/SolarEvaporatorContainer.java delete mode 100644 ihl/processing/chemistry/SolarEvaporatorGui.java delete mode 100644 ihl/processing/chemistry/SolarEvaporatorTileEntity.java delete mode 100644 ihl/processing/invslots/IHLInvSlotOutput.java delete mode 100644 ihl/processing/invslots/InvSlotConsumableLiquidIHL.java delete mode 100644 ihl/processing/invslots/InvSlotUpgradeIHL.java delete mode 100644 ihl/processing/invslots/SlotInvSlotIronWorkbench.java delete mode 100644 ihl/processing/invslots/SlotInvSlotOutputInProgress.java delete mode 100644 ihl/processing/metallurgy/AchesonFurnaceGui.java delete mode 100644 ihl/processing/metallurgy/AchesonFurnanceContainer.java delete mode 100644 ihl/processing/metallurgy/AchesonFurnanceTileEntity.java delete mode 100644 ihl/processing/metallurgy/BasicElectricMotorTileEntity.java delete mode 100644 ihl/processing/metallurgy/CoilerContainer.java delete mode 100644 ihl/processing/metallurgy/CoilerGui.java delete mode 100644 ihl/processing/metallurgy/CoilerModel.java delete mode 100644 ihl/processing/metallurgy/CoilerRender.java delete mode 100644 ihl/processing/metallurgy/CoilerTileEntity.java delete mode 100644 ihl/processing/metallurgy/Crucible.java delete mode 100644 ihl/processing/metallurgy/CrucibleContainer.java delete mode 100644 ihl/processing/metallurgy/CrucibleGui.java delete mode 100644 ihl/processing/metallurgy/CrucibleInventory.java delete mode 100644 ihl/processing/metallurgy/CrucibleSlot.java delete mode 100644 ihl/processing/metallurgy/DetonationSprayingMachineContainer.java delete mode 100644 ihl/processing/metallurgy/DetonationSprayingMachineGui.java delete mode 100644 ihl/processing/metallurgy/DetonationSprayingMachineModel.java delete mode 100644 ihl/processing/metallurgy/DetonationSprayingMachineRender.java delete mode 100644 ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java delete mode 100644 ihl/processing/metallurgy/ElectricEngineItem.java delete mode 100644 ihl/processing/metallurgy/ExtruderContainer.java delete mode 100644 ihl/processing/metallurgy/ExtruderGui.java delete mode 100644 ihl/processing/metallurgy/ExtruderModel.java delete mode 100644 ihl/processing/metallurgy/ExtruderTileEntity.java delete mode 100644 ihl/processing/metallurgy/GasWeldingStationContainer.java delete mode 100644 ihl/processing/metallurgy/GasWeldingStationGui.java delete mode 100644 ihl/processing/metallurgy/GasWeldingStationModel.java delete mode 100644 ihl/processing/metallurgy/GasWeldingStationTileEntity.java delete mode 100644 ihl/processing/metallurgy/IProductionLine.java delete mode 100644 ihl/processing/metallurgy/ImpregnatingMachineContainer.java delete mode 100644 ihl/processing/metallurgy/ImpregnatingMachineGui.java delete mode 100644 ihl/processing/metallurgy/ImpregnatingMachineRender.java delete mode 100644 ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java delete mode 100644 ihl/processing/metallurgy/InjectionMoldBlock.java delete mode 100644 ihl/processing/metallurgy/InjectionMoldTileEntity.java delete mode 100644 ihl/processing/metallurgy/LatheContainer.java delete mode 100644 ihl/processing/metallurgy/LatheGui.java delete mode 100644 ihl/processing/metallurgy/LathePart1Model.java delete mode 100644 ihl/processing/metallurgy/LathePart1TileEntity.java delete mode 100644 ihl/processing/metallurgy/LathePart2Model.java delete mode 100644 ihl/processing/metallurgy/LathePart2TileEntity.java delete mode 100644 ihl/processing/metallurgy/MachineBaseContainer.java delete mode 100644 ihl/processing/metallurgy/MachineBaseTileEntity.java delete mode 100644 ihl/processing/metallurgy/MuffleFurnaceGui.java delete mode 100644 ihl/processing/metallurgy/MuffleFurnanceContainer.java delete mode 100644 ihl/processing/metallurgy/MuffleFurnanceTileEntity.java delete mode 100644 ihl/processing/metallurgy/RollingMachineContainer.java delete mode 100644 ihl/processing/metallurgy/RollingMachineGui.java delete mode 100644 ihl/processing/metallurgy/RollingMachinePart1Model.java delete mode 100644 ihl/processing/metallurgy/RollingMachinePart1TileEntity.java delete mode 100644 ihl/processing/metallurgy/RollingMachinePart2Model.java delete mode 100644 ihl/processing/metallurgy/RollingMachinePart2TileEntity.java delete mode 100644 ihl/processing/metallurgy/RollingMachineRender.java delete mode 100644 ihl/processing/metallurgy/VulcanizationExtrudingMoldModel.java delete mode 100644 ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java delete mode 100644 ihl/processing/metallurgy/WireMillContainer.java delete mode 100644 ihl/processing/metallurgy/WireMillGui.java delete mode 100644 ihl/processing/metallurgy/WireMillTileEntity.java delete mode 100644 ihl/processing/metallurgy/WoodenRollingMachineContainer.java delete mode 100644 ihl/processing/metallurgy/WoodenRollingMachineGui.java delete mode 100644 ihl/processing/metallurgy/WoodenRollingMachinePart1Model.java delete mode 100644 ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java delete mode 100644 ihl/processing/metallurgy/WoodenRollingMachinePart2Model.java delete mode 100644 ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java delete mode 100644 ihl/processing/metallurgy/WoodenRollingMachineRender.java (limited to 'ihl/processing') diff --git a/ihl/processing/chemistry/ApparatusProcessableInvSlot.java b/ihl/processing/chemistry/ApparatusProcessableInvSlot.java deleted file mode 100644 index bfed5c9..0000000 --- a/ihl/processing/chemistry/ApparatusProcessableInvSlot.java +++ /dev/null @@ -1,59 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.ArrayList; -import java.util.List; - -import ic2.api.recipe.IRecipeInput; -import ic2.core.block.TileEntityInventory; -import ic2.core.block.invslot.InvSlot; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class ApparatusProcessableInvSlot extends InvSlot { - - public ApparatusProcessableInvSlot(TileEntityInventory base1, String name1, int oldStartIndex1, Access access1, - int count, int stackSizeLimit1) { - super(base1, name1, oldStartIndex1, Access.I, count); - this.setStackSizeLimit(stackSizeLimit1); - } - - public List getItemStackList() { - List list = new ArrayList(); - for (int i = 0; i < this.size(); i++) { - if (get(i) != null) { - list.add(get(i)); - } - } - return list; - } - - public ItemStack getItemStack(Item item) { - for (int i = 0; i < this.size(); i++) { - if (get(i) != null && get(i).getItem() == item) { - return get(i); - } - } - return null; - } - - public void replaceItemStack(ItemStack stack1) { - for (int i = 0; i < this.size(); i++) { - if (this.get(i) != null && this.get(i).getItem() == stack1.getItem()) { - this.put(i, stack1); - } - } - } - - public void consume(IRecipeInput iRecipeInput) { - for (int i = 0; i < this.size(); i++) { - if (this.get(i) != null && iRecipeInput.matches(this.get(i))) { - this.get(i).stackSize -= iRecipeInput.getAmount(); - if (this.get(i).stackSize <= 0) { - this.put(i, null); - return; - } - } - } - } - -} diff --git a/ihl/processing/chemistry/BasicElectricMotorContainer.java b/ihl/processing/chemistry/BasicElectricMotorContainer.java deleted file mode 100644 index a32e006..0000000 --- a/ihl/processing/chemistry/BasicElectricMotorContainer.java +++ /dev/null @@ -1,74 +0,0 @@ -package ihl.processing.chemistry; - -import ic2.core.ContainerBase; -import ic2.core.slot.SlotInvSlot; -import ihl.processing.metallurgy.BasicElectricMotorTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; - -public class BasicElectricMotorContainer extends ContainerBase { - - protected BasicElectricMotorTileEntity tileEntity; - public short lastProgress = -1; - public short lastEnergy = -1; - private final static int height = 166; - - public BasicElectricMotorContainer(EntityPlayer entityPlayer, T tileEntity1) { - super(tileEntity1); - this.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.dischargeSlot, 0, 8, 33)); - for (col = 0; col < 4; ++col) { - this.addSlotToContainer(new SlotInvSlot(tileEntity1.upgradeSlot, col, 152, 8 + col * 18)); - } - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - - if (this.tileEntity.progress != this.lastProgress) { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - - if ((short) this.tileEntity.energy != this.lastEnergy) { - icrafting.sendProgressBarUpdate(this, 2, (short) this.tileEntity.energy); - } - } - - this.lastProgress = this.tileEntity.progress; - this.lastEnergy = (short) this.tileEntity.energy; - } - - @Override - public void updateProgressBar(int index, int value) { - super.updateProgressBar(index, value); - switch (index) { - case 0: - this.tileEntity.progress = (short) value; - break; - case 1: - break; - case 2: - this.tileEntity.energy = value; - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/BatteryItem.java b/ihl/processing/chemistry/BatteryItem.java deleted file mode 100644 index b9c5435..0000000 --- a/ihl/processing/chemistry/BatteryItem.java +++ /dev/null @@ -1,194 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.item.ElectricItem; -import ic2.api.item.IElectricItem; -import ic2.api.item.IItemHudInfo; -import ihl.IHLCreativeTab; -import ihl.IHLModInfo; -import ihl.utils.IHLUtils; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -public class BatteryItem extends Item implements IElectricItem, IItemHudInfo -{ - public int maxCharge=65536; - public int transferLimit = 4096; - public int tier = 4; - private static Map iconMap = new HashMap(); - private static Map nameMap = new HashMap(); - private static Map descriptionMap = new HashMap(); - - public BatteryItem() - { - super(); - this.setMaxDamage(27); - this.setCreativeTab(IHLCreativeTab.tab); - this.maxStackSize=1; - this.canRepair=false; - this.setUnlocalizedName("battery"); - } - - public static void init() - { - BatteryItem item = new BatteryItem(); - GameRegistry.registerItem(item,item.getUnlocalizedName()); - Type[] var1 = Type.values(); - for(int i=0;i getHudInfo(ItemStack itemStack) - { - LinkedList info = new LinkedList(); - info.add(ElectricItem.manager.getToolTip(itemStack)); - return info; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - Type[] var1 = Type.values(); - for(int i=0;i { - - protected ChemicalReactorTileEntity tileEntity; - public int lastFluidAmount = -1; - public int lastNumberOfFluids = -1; - public List fluidTankFluidList; - - public ChemicalReactorContainer(EntityPlayer entityPlayer, ChemicalReactorTileEntity tileEntity1) { - super(entityPlayer, tileEntity1); - this.tileEntity = tileEntity1; - fluidTankFluidList = tileEntity.getFluidTank().getFluidList(); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 60, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 60, 15)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 60, 33)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 122 - 18, 15)); - 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)); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (this.tileEntity.getTankAmount() != this.lastFluidAmount - || this.tileEntity.getNumberOfFluidsInTank() != this.lastNumberOfFluids) { - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); - this.lastFluidAmount = this.tileEntity.getTankAmount(); - } -} diff --git a/ihl/processing/chemistry/ChemicalReactorGui.java b/ihl/processing/chemistry/ChemicalReactorGui.java deleted file mode 100644 index de22f76..0000000 --- a/ihl/processing/chemistry/ChemicalReactorGui.java +++ /dev/null @@ -1,79 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -@SideOnly(Side.CLIENT) -public class ChemicalReactorGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIChemicalReactor.png"); - private ChemicalReactorContainer container; - private int mixerFrame=0; - - public ChemicalReactorGui (ChemicalReactorContainer container1) { - //the container is instanciated and passed to the superclass for handling - super(container1); - this.container=container1; - } - - @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) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(12, 16 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); - this.drawTexturedModalRect(30, 29, getFrameX(i1), getFrameY(i1),24,24); - if(mixerFrame++>4) - { - mixerFrame=0; - } - } - else - { - mixerFrame=0; - } - this.drawTexturedModalRect(103-18, 52, 246, 226+6*mixerFrame,10,6); - if (this.container.tileEntity.getTankAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102-18, 28, 114-18, 59, zLevel, par1, par2, xOffset, yOffset); - } - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - private int getFrameY(int number) - { - return (number % 10) * 24 + 14; - } - - private int getFrameX(int number) - { - return (number / 10) * 24 + 176; - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/ChemicalReactorTileEntity.java b/ihl/processing/chemistry/ChemicalReactorTileEntity.java deleted file mode 100644 index 7de2ccf..0000000 --- a/ihl/processing/chemistry/ChemicalReactorTileEntity.java +++ /dev/null @@ -1,294 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ic2.core.IC2; -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 ihl.processing.invslots.IHLInvSlotOutput; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.processing.metallurgy.BasicElectricMotorTileEntity; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler -{ - private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("chemicalreactor"); - public final ApparatusProcessableInvSlot input; - public final IHLInvSlotOutput outputSlot; - public final InvSlotConsumableLiquidIHL drainInputSlot; - public final InvSlotConsumableLiquidIHL fillInputSlot; - public final InvSlotOutput emptyFluidItemsSlot; - private final IHLFluidTank fluidTank = new IHLFluidTank(8000); - public short temperature=20; - - public ChemicalReactorTileEntity() { - super(); - this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 2); - 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.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.I, 2, 64); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankTag = new NBTTagCompound(); - this.fluidTank.writeToNBT(fluidTankTag); - nbttagcompound.setTag("fluidTank", fluidTankTag); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=side; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("chemicalReactor"); - } - - @Override - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - } - - @Override - public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) - { - switch(from) - { - case UP: - return this.fluidTank.drainLightest(amount, doDrain); - case NORTH: - return this.fluidTank.drainLightest(amount, doDrain); - case SOUTH: - return this.fluidTank.drainLightest(amount, doDrain); - case WEST: - return this.fluidTank.drainLightest(amount, doDrain); - case EAST: - return this.fluidTank.drainLightest(amount, doDrain); - case DOWN: - return this.fluidTank.drain(amount, doDrain); - default: - return this.fluidTank.drain(amount, doDrain); - } - } - - //1.7.10 API - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return true; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return true; - } - - @Override - public String getInventoryName() { - return "chemicalReactor"; - } - - public float getRenderLiquidLevel() - { - return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity(); - } - - @Override - public int gaugeProgressScaled(int i) - { - return this.progress * i / operationLength; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new ChemicalReactorGui(new ChemicalReactorContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) - { - this.fluidTank.sortFluidsByDensity(); - return new ChemicalReactorContainer(player, this); - } - - @Override - public void onGuiClosed(EntityPlayer player) {} - - @Override - public boolean canOperate() - { - UniversalRecipeOutput output = getOutput(); - if(output!=null && this.outputSlot.canAdd(getOutput().getItemOutputs())) - { - if(output.specialConditions) - { - return this.checkSpecialConditions(); - } - else - { - return true; - } - } - 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; - } - - @SuppressWarnings("unchecked") - public UniversalRecipeOutput getOutput() - { - return ChemicalReactorTileEntity.recipeManager.getOutputFor(this.getInput()[0],this.getInput()[1]); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public List[] getInput() - { - return new List[] {fluidTank.getFluidList(), this.input.getItemStackList()}; - } - - @Override - @SuppressWarnings({ "unchecked"}) - public void operate() - { - UniversalRecipeInput recipeInput = ChemicalReactorTileEntity.recipeManager.getRecipeInput(this.getInput()[0],this.getInput()[1]); - UniversalRecipeOutput output1 = getOutput(); - for(int i=0; i getRecipes() { - return recipeManager.getRecipes(); - } - - public static void addRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2) - { - 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((new FluidStack[] {fluidStackInput1, fluidStackInput2}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); - } - - public IHLFluidTank getFluidTank() - { - return this.fluidTank; - } - -} \ No newline at end of file diff --git a/ihl/processing/chemistry/CryogenicDistillerContainer.java b/ihl/processing/chemistry/CryogenicDistillerContainer.java deleted file mode 100644 index 988b844..0000000 --- a/ihl/processing/chemistry/CryogenicDistillerContainer.java +++ /dev/null @@ -1,39 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fluids.FluidStack; - -public class CryogenicDistillerContainer extends BasicElectricMotorContainer { - - public CryogenicDistillerTileEntity tileEntity; - private int lastNumberOfFluids = -1; - private int lastFluidAmount = -1; - public List fluidTankFluidList; - - public CryogenicDistillerContainer(EntityPlayer entityPlayer, - CryogenicDistillerTileEntity lathePart1TileEntity) { - super(entityPlayer, lathePart1TileEntity); - tileEntity=lathePart1TileEntity; - fluidTankFluidList=tileEntity.fluidTankProducts.getFluidList(); - 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)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fluidItemsSlot,1, 103, 15)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - if (this.tileEntity.fluidTankProducts.getFluidAmount() != this.lastFluidAmount || this.tileEntity.fluidTankProducts.getNumberOfFluids() != this.lastNumberOfFluids) - { - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - this.lastNumberOfFluids = this.tileEntity.fluidTankProducts.getNumberOfFluids(); - this.lastFluidAmount = this.tileEntity.fluidTankProducts.getFluidAmount(); - } -} diff --git a/ihl/processing/chemistry/CryogenicDistillerGui.java b/ihl/processing/chemistry/CryogenicDistillerGui.java deleted file mode 100644 index a8f9f0f..0000000 --- a/ihl/processing/chemistry/CryogenicDistillerGui.java +++ /dev/null @@ -1,71 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import ic2.core.IC2; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -public class CryogenicDistillerGui extends GuiContainer { - - private CryogenicDistillerContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUICryogenicDistiller.png"); - - public CryogenicDistillerGui(CryogenicDistillerContainer latheContainer) { - super(latheContainer); - container = latheContainer; - } - - @SuppressWarnings("unchecked") - @Override - public void initGui() { - super.initGui(); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.buttonList.add(new GuiButton(0, x + 7, y + 50, 49, 20, "Empty")); - } - - @Override - public void actionPerformed(GuiButton button) { - super.actionPerformed(button); - IC2.network.get().initiateClientTileEntityEvent(this.container.tileEntity, button.id); - } - - @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.getEnergy() > 0D) { - 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.9F); - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12), 12); - this.drawTexturedModalRect(9, 15 + 12 - i1, 176, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18), 18); - this.drawTexturedModalRect(81, 35, 198, 0, i1 + 1, 13); - } - if (this.container.tileEntity.fluidTankProducts.getFluid() != null - && this.container.tileEntity.fluidTankProducts.getFluidAmount() > 0) { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankProducts, 125, 28, 137, 67, - zLevel, par1, par2, xOffset, yOffset); - } - } - - @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); - } -} diff --git a/ihl/processing/chemistry/CryogenicDistillerTileEntity.java b/ihl/processing/chemistry/CryogenicDistillerTileEntity.java deleted file mode 100644 index e197088..0000000 --- a/ihl/processing/chemistry/CryogenicDistillerTileEntity.java +++ /dev/null @@ -1,211 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ic2.core.block.invslot.InvSlot; -import ic2.core.block.invslot.InvSlotConsumableLiquid; -import ic2.core.block.invslot.InvSlotOutput; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.processing.metallurgy.BasicElectricMotorTileEntity; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler { - - public final InvSlotConsumableLiquidIHL fillInputSlotInput; - public final InvSlotOutput fluidItemsSlot; - public final InvSlotConsumableLiquidIHL fillInputSlotProducts; - - private IHLFluidTank fluidTankInput = new IHLFluidTank(8000); - public IHLFluidTank fluidTankProducts = new IHLFluidTank(8000); - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("cryogenicdistiller"); - - public CryogenicDistillerTileEntity() { - super(); - 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); - } - - @Override - public String getInventoryName() { - return "CryogenicDistiller"; - } - - @Override - public void updateEntityServer() { - super.updateEntityServer(); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlotProducts, null, fluidItemsSlot, fluidTankProducts); - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) { - return IHLUtils.getThisModItemStack("cryogenicDistiller"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new CryogenicDistillerGui(new CryogenicDistillerContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new CryogenicDistillerContainer(player, this); - } - - @Override - public void operate() { - UniversalRecipeInput ri = CryogenicDistillerTileEntity.recipeManager.getRecipeInput(getInput()); - this.fluidTankProducts.fill(getOutput().getFluidOutputs(), true); - this.fluidTankInput.drain(ri.getFluidInputs().get(0), true); - TileEntity teOnTop = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); - if (teOnTop instanceof IFluidHandler && this.fluidTankProducts.getLigthestFluid() != null) { - IFluidHandler topFH = (IFluidHandler) teOnTop; - if (topFH.canFill(ForgeDirection.DOWN, this.fluidTankProducts.getLigthestFluid().getFluid())) { - FluidStack fsToDrain = this.fluidTankProducts.getLigthestFluid().copy(); - fsToDrain.amount = topFH.fill(ForgeDirection.DOWN, fsToDrain, true); - this.fluidTankProducts.drain(fsToDrain, true); - } - } - ForgeDirection orientation = ForgeDirection.getOrientation(this.getFacing()); - TileEntity teOnFront = worldObj.getTileEntity(xCoord + orientation.offsetX, yCoord, - zCoord + orientation.offsetZ); - if (teOnFront instanceof IFluidHandler && this.fluidTankProducts.getFluid() != null) { - IFluidHandler frontFH = (IFluidHandler) teOnFront; - if (frontFH.canFill(orientation, this.fluidTankProducts.getFluid().getFluid())) { - FluidStack fsToDrain = this.fluidTankProducts.getFluid().copy(); - fsToDrain.amount = frontFH.fill(orientation, fsToDrain, true); - this.fluidTankProducts.drain(fsToDrain, true); - } - } - } - - public UniversalRecipeOutput getOutput() { - return CryogenicDistillerTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public List[] getInput() { - return new List[] {Arrays.asList(new FluidStack[] {this.fluidTankInput.getLigthestFluid()}), null }; - } - - @Override - public boolean canOperate() { - return this.getOutput() != null; - } - - @Override - public void onGuiClosed(EntityPlayer arg0) { - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) { - super.readFromNBT(nbttagcompound); - this.fluidTankInput.readFromNBT(nbttagcompound.getCompoundTag("fluidTankInput")); - this.fluidTankProducts.readFromNBT(nbttagcompound.getCompoundTag("fluidTankProducts")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankInputTag = new NBTTagCompound(); - this.fluidTankInput.writeToNBT(fluidTankInputTag); - nbttagcompound.setTag("fluidTankInput", fluidTankInputTag); - NBTTagCompound fluidTankProductsTag = new NBTTagCompound(); - this.fluidTankProducts.writeToNBT(fluidTankProductsTag); - nbttagcompound.setTag("fluidTankProducts", fluidTankProductsTag); - } - - public static void addRecipe(FluidStack input, FluidStack output, FluidStack output2, boolean specialCondition) { - if (output2 != null) { - recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] { input }, null), - new UniversalRecipeOutput(new FluidStack[] { output, output2 }, null, 20, specialCondition)); - } else { - recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] { input }, null), - new UniversalRecipeOutput(new FluidStack[] { output }, null, 20, specialCondition)); - } - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - public boolean canProcess() { - return this.energy >= this.energyConsume; - } - - @Override - public boolean canDrain(ForgeDirection dir, Fluid arg1) { - return dir.equals(ForgeDirection.getOrientation(this.getFacing())) - || dir.equals(ForgeDirection.UP); - } - - @Override - public boolean canFill(ForgeDirection dir, Fluid fluid) { - return dir.equals(ForgeDirection.getOrientation(this.getFacing()).getOpposite()); - } - - @Override - public FluidStack drain(ForgeDirection dir, FluidStack fstack, boolean doDrain) { - if (this.canDrain(dir, null)) { - return this.fluidTankProducts.drain(fstack, doDrain); - } - return null; - } - - @Override - public FluidStack drain(ForgeDirection dir, int amount, boolean doDrain) { - if (this.canDrain(dir, null)) { - if (dir.equals(ForgeDirection.UP)) { - return this.fluidTankProducts.drainLightest(amount, doDrain); - } - return this.fluidTankProducts.drain(amount, doDrain); - } - return null; - } - - @Override - public int fill(ForgeDirection dir, FluidStack fstack, boolean doFill) { - if (fstack != null && fstack.getFluid() != null && this.canFill(dir, fstack.getFluid())) { - return this.fluidTankInput.fill(fstack, doFill); - } - return 0; - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection dir) { - return new FluidTankInfo[] { this.fluidTankInput.getInfo(), this.fluidTankProducts.getInfo() }; - } - - @Override - public void onNetworkEvent(EntityPlayer player, int event) { - switch (event) { - case 0: - this.fluidTankProducts.setEmpty(); - break; - } - } - -} diff --git a/ihl/processing/chemistry/DosingPumpContainer.java b/ihl/processing/chemistry/DosingPumpContainer.java deleted file mode 100644 index 5a4cb21..0000000 --- a/ihl/processing/chemistry/DosingPumpContainer.java +++ /dev/null @@ -1,95 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraftforge.fluids.FluidStack; - -public class DosingPumpContainer extends ContainerBase { - - protected DosingPumpTileEntity tileEntity; - public int lastFluidAmount = -1; - public int lastNumberOfFluids = -1; - public short lastProgress = -1; - public int lastFluidAmountSetpoint = -1; - public short lastEnergy = -1; - private final static int height = 166; - public List fluidTankFluidList; - - public DosingPumpContainer(EntityPlayer entityPlayer, DosingPumpTileEntity tileEntity1) { - super(tileEntity1); - this.tileEntity = tileEntity1; - fluidTankFluidList = tileEntity.getFluidTank().getFluidList(); - 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.fillInputSlot, 0, 44, 50)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 44, 14)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 44, 32)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 32)); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - - if (this.tileEntity.getTankAmount() != this.lastFluidAmount - || this.tileEntity.getNumberOfFluidsInTank() != this.lastNumberOfFluids) { - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - - if (this.tileEntity.progress != this.lastProgress) { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - - if (this.tileEntity.fluidAmountSetpoint != this.lastFluidAmountSetpoint) { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.fluidAmountSetpoint); - } - - if ((short) this.tileEntity.energy != this.lastEnergy) { - icrafting.sendProgressBarUpdate(this, 2, (short) this.tileEntity.energy); - } - } - - this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); - this.lastFluidAmount = this.tileEntity.getTankAmount(); - this.lastProgress = this.tileEntity.progress; - this.lastFluidAmountSetpoint = this.tileEntity.fluidAmountSetpoint; - this.lastEnergy = (short) this.tileEntity.energy; - } - - @Override - public void updateProgressBar(int index, int value) { - super.updateProgressBar(index, value); - switch (index) { - case 0: - this.tileEntity.progress = (short) value; - break; - case 1: - this.tileEntity.fluidAmountSetpoint = (short) value; - break; - case 2: - this.tileEntity.energy = value; - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/DosingPumpGui.java b/ihl/processing/chemistry/DosingPumpGui.java deleted file mode 100644 index dde4f13..0000000 --- a/ihl/processing/chemistry/DosingPumpGui.java +++ /dev/null @@ -1,103 +0,0 @@ -package ihl.processing.chemistry; - -import java.awt.event.KeyEvent; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.ClientProxy; -import ihl.IHLMod; -import ihl.utils.IHLRenderUtils; -import ihl.utils.IHLUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -@SideOnly(Side.CLIENT) -public class DosingPumpGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIDosingPump.png"); - private DosingPumpContainer container; - private GuiTextField setpointTextField; - private int lastFluidAmountSetpoint = -1; - private final static int TANK_HEIGHT = 58; - - public DosingPumpGui(DosingPumpContainer container1) { - // the container is instanciated and passed to the superclass for - // handling - super(container1); - this.container = container1; - setpointTextField = new GuiTextField(Minecraft.getMinecraft().fontRenderer, 106, 34, 62, 16); - setpointTextField.setText(Integer.toString(this.container.tileEntity.fluidAmountSetpoint)); - setpointTextField.setFocused(true); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if(lastFluidAmountSetpoint!= this.container.tileEntity.fluidAmountSetpoint){ - setpointTextField.setText(Integer.toString(this.container.tileEntity.fluidAmountSetpoint)); - lastFluidAmountSetpoint= this.container.tileEntity.fluidAmountSetpoint; - } - 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) { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12), 12); - this.drawTexturedModalRect(12, 15 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - i1 = TANK_HEIGHT - this.container.tileEntity.fluidAmountSetpoint * TANK_HEIGHT - / this.container.tileEntity.getFluidTank().getCapacity(); - this.drawTexturedModalRect(78, 6 + i1, 176, 14, 25, 7); - if (this.container.tileEntity.getTankAmount() > 0) { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 82, 10, 94, - 67, zLevel, par1, par2, xOffset, yOffset); - } - setpointTextField.drawTextBox(); - IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.dosingPump.tip")); - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - @Override - protected void keyTyped(char characterTyped, int keyIndex) { - super.keyTyped(characterTyped, keyIndex); - this.setpointTextField.textboxKeyTyped(characterTyped, keyIndex); - // 28 - enter; 156 - numpad enter - if (keyIndex == KeyEvent.VK_ACCEPT || keyIndex == KeyEvent.VK_ENTER || keyIndex == 28 || keyIndex == 156) { - int fluidAmountSetpoint = (short) Math.max(1, - Math.min(this.container.tileEntity.getFluidTank().getCapacity(), - IHLUtils.parseIntSafe(this.setpointTextField.getText(), 100))); - this.setpointTextField.setText(Integer.toString(fluidAmountSetpoint)); - this.setpointTextField.setFocused(false); - ((ClientProxy)IHLMod.proxy).sendIntegerFieldValueFromClientToServer(fluidAmountSetpoint, "fluidAmountSetpoint", this.container.tileEntity); - } - } - @Override - public void mouseClicked(int mouseX, int mouseY, int mouseButton) { - super.mouseClicked(mouseX, mouseY, mouseButton); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - if (mouseX >= x + setpointTextField.xPosition && - mouseX <= x + setpointTextField.xPosition + setpointTextField.width && - mouseY >= y + setpointTextField.yPosition && - mouseY <= y + setpointTextField.yPosition + setpointTextField.height) { - setpointTextField.setFocused(true); - } - } - - -} \ No newline at end of file diff --git a/ihl/processing/chemistry/DosingPumpTileEntity.java b/ihl/processing/chemistry/DosingPumpTileEntity.java deleted file mode 100644 index e1e4996..0000000 --- a/ihl/processing/chemistry/DosingPumpTileEntity.java +++ /dev/null @@ -1,226 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.block.invslot.InvSlot; -import ic2.core.block.invslot.InvSlotConsumableLiquid; -import ic2.core.block.invslot.InvSlotOutput; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.processing.metallurgy.BasicElectricMotorTileEntity; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class DosingPumpTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler { - public final InvSlotConsumableLiquidIHL drainInputSlot; - public final InvSlotConsumableLiquidIHL fillInputSlot; - public final InvSlotOutput emptyFluidItemsSlot; - private final IHLFluidTank fluidTank = new IHLFluidTank(8000); - public int fluidAmountSetpoint = 8000; - private boolean prevIsPowered = false; - private boolean tickFree=false; - - public DosingPumpTileEntity() { - super(); - 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); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) { - super.readFromNBT(nbttagcompound); - this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); - this.fluidAmountSetpoint = nbttagcompound.getInteger("fluidAmountSetpoint"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankTag = new NBTTagCompound(); - this.fluidTank.writeToNBT(fluidTankTag); - nbttagcompound.setTag("fluidTank", fluidTankTag); - nbttagcompound.setInteger("fluidAmountSetpoint", this.fluidAmountSetpoint); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing() != side; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("dosingPump"); - } - - @Override - public boolean enableUpdateEntity() { - return IC2.platform.isSimulating(); - } - - @Override - public void updateEntityServer() { - super.updateEntityServer(); - this.tickFree = true; - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - } - - @Override - public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) { - switch (from) { - case UP: - return this.fluidTank.drainLightest(amount, doDrain); - case NORTH: - return this.fluidTank.drainLightest(amount, doDrain); - case SOUTH: - return this.fluidTank.drainLightest(amount, doDrain); - case WEST: - return this.fluidTank.drainLightest(amount, doDrain); - case EAST: - return this.fluidTank.drainLightest(amount, doDrain); - case DOWN: - return this.fluidTank.drain(amount, doDrain); - default: - return this.fluidTank.drain(amount, doDrain); - } - } - - // 1.7.10 API - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return true; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return !direction.equals(ForgeDirection.getOrientation(this.getFacing())); - } - - @Override - public String getInventoryName() { - return "dosingPump"; - } - - public float getRenderLiquidLevel() { - return (float) this.fluidTank.getFluidAmount() / (float) this.fluidTank.getCapacity(); - } - - @Override - public int gaugeProgressScaled(int i) { - return this.progress * i / operationLength; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new DosingPumpGui(new DosingPumpContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - this.fluidTank.sortFluidsByDensity(); - return new DosingPumpContainer(player, this); - } - - @Override - public void onGuiClosed(EntityPlayer player) { - } - - @Override - public boolean canOperate() { - return false; - } - - @Override - public void operate() { - int fluidAmountToDrain = fluidAmountSetpoint; - ForgeDirection dir = ForgeDirection.getOrientation(this.getFacing()); - TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); - if (te instanceof IFluidHandler) { - IFluidHandler fhte = (IFluidHandler) te; - for (int i = 0; i < this.fluidTank.getNumberOfFluids(); i++) { - FluidStack drained = this.fluidTank.drain(fluidAmountToDrain, true); - fluidAmountToDrain -= drained.amount; - if (fhte.canFill(dir, drained.getFluid())) { - fhte.fill(dir, drained, true); - } - if (fluidAmountToDrain <= 0) { - break; - } - } - } - this.energy-=this.energyConsume/10; - } - - @Override - public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { - if (fluidTank.getFluid() != null && fluidTank.getFluid().containsFluid(fluidStack)) { - return this.fluidTank.drain(fluidStack, doDrain); - } - return null; - } - - @Override - public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return this.fluidTank.fill(arg1, arg2); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { - return new FluidTankInfo[] { this.fluidTank.getInfo() }; - } - - public boolean needsFluid() { - return this.fluidTank.getFluidAmount() <= this.fluidTank.getCapacity(); - } - - public FluidStack getFluidStackfromTank() { - return this.fluidTank.getFluid(); - } - - public int getTankAmount() { - return this.fluidTank.getFluidAmount(); - } - - public int gaugeLiquidScaled(int i, int index) { - return this.fluidTank.getFluidAmount() <= 0 ? 0 - : this.fluidTank.getFluidAmount(index) * i / this.fluidTank.getCapacity(); - } - - public int getNumberOfFluidsInTank() { - return this.fluidTank.getNumberOfFluids(); - } - - public IHLFluidTank getFluidTank() { - return this.fluidTank; - } - - @Override - public List[] getInput() { - return null; - } - - public void setPowered(boolean isPowered) { - if (isPowered && !prevIsPowered && this.energy > 0 && this.tickFree) { - this.operate(); - } - prevIsPowered = isPowered; - this.tickFree = false; // Only one operation per tick max - } - -} \ No newline at end of file diff --git a/ihl/processing/chemistry/ElectricEvaporatorBlock.java b/ihl/processing/chemistry/ElectricEvaporatorBlock.java deleted file mode 100644 index f65b76d..0000000 --- a/ihl/processing/chemistry/ElectricEvaporatorBlock.java +++ /dev/null @@ -1,220 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Random; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.IHLCreativeTab; -import ihl.IHLModInfo; -import net.minecraft.block.Block; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -public class ElectricEvaporatorBlock extends Block implements ITileEntityProvider{ - - IIcon textureFrontActive, textureSide, textureBottom, textureTop; - - public ElectricEvaporatorBlock(Material material) - { - super(material); - this.setCreativeTab(IHLCreativeTab.tab); - } - - @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) - { - return new ItemStack(Blocks.furnace,1).getItem(); - } - - @Override - public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) - { - ItemStack result = new ItemStack(Blocks.furnace,1); - this.dropBlockAsItem(world, x, y, z, result); - } - - @Override - public TileEntity createNewTileEntity(World world, int var2) { - return new ElectricEvaporatorTileEntity(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorFront"); - this.textureFrontActive = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorFrontActive"); - this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorSide"); - this.textureTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorTop"); - this.textureBottom = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorBottom"); - } - - @Override - public boolean hasTileEntity(int metadata) - { - return true; - } - - @Override - public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer entityPlayer,int i,float pos_x,float pos_y,float pos_z){ - TileEntity te = world.getTileEntity(x,y,z); - if(te instanceof ElectricEvaporatorTileEntity) - { - ElectricEvaporatorTileEntity bte = (ElectricEvaporatorTileEntity)te; - if (bte == null || entityPlayer.isSneaking()) { - return false; - } - else - { - return bte.getGui(entityPlayer); - } - } - return false; - } - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) - { - int var7 = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - TileEntity t = world.getTileEntity(x, y, z); - if(t!=null && t instanceof ElectricEvaporatorTileEntity) - { - ElectricEvaporatorTileEntity te = (ElectricEvaporatorTileEntity)t; - if(player.isSneaking()) - { - switch(var7) - { - case 0: - te.setFacing((short) 3); - break; - case 1: - te.setFacing((short) 4); - break; - case 2: - te.setFacing((short) 2); - break; - case 3: - te.setFacing((short) 5); - break; - default: - break; - } - } - else - { - switch(var7) - { - case 0: - te.setFacing((short) 2); - break; - case 1: - te.setFacing((short) 5); - break; - case 2: - te.setFacing((short) 3); - break; - case 3: - te.setFacing((short) 4); - break; - default: - break; - } - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) - { - IIcon faceIcon=this.blockIcon; - int facing=3; - int mask[] = { - 0,1,2,3,4,5, - 1,0,3,2,4,5, - 2,3,0,1,4,5, - 2,3,1,0,4,5, - 2,3,5,4,0,1, - 2,3,4,5,1,0 - }; - TileEntity te = world.getTileEntity(x, y, z); - if(te!=null) - { - ElectricEvaporatorTileEntity tebh = (ElectricEvaporatorTileEntity) te; - facing=tebh.getFacing(); - if(tebh.getActive()) - { - faceIcon=this.textureFrontActive; - } - } - - switch (mask[facing*6+side]) - { - case 0: - return faceIcon; - case 1: - return this.textureSide; - case 2: - return this.textureBottom; - case 3: - return this.textureTop; - case 4: - return this.textureSide; - case 5: - return this.textureSide; - default: - return this.textureSide; - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) - { - switch (side) - { - case 0: - return this.textureBottom; - case 1: - return this.textureTop; - case 2: - return this.textureSide; - case 3: - return this.blockIcon; - case 4: - return this.textureSide; - case 5: - return this.textureSide; - default: - return this.textureSide; - } - } - - @Override - public void randomDisplayTick(World world, int x, int y, int z, Random random) - { - TileEntity te = world.getTileEntity(x, y, z); - if(te instanceof ElectricEvaporatorTileEntity) - { - ElectricEvaporatorTileEntity ete = (ElectricEvaporatorTileEntity) te; - if(ete.getActive()) - { - world.spawnParticle("snowshovel", x+0.2D, y+1.2D, z+0.2D, 0D, 0.05D, 0D); - } - } - } -} diff --git a/ihl/processing/chemistry/ElectricEvaporatorContainer.java b/ihl/processing/chemistry/ElectricEvaporatorContainer.java deleted file mode 100644 index d981d94..0000000 --- a/ihl/processing/chemistry/ElectricEvaporatorContainer.java +++ /dev/null @@ -1,113 +0,0 @@ -package ihl.processing.chemistry; - -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; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class ElectricEvaporatorContainer extends ContainerBase { - - protected ElectricEvaporatorTileEntity tileEntity; - public int lastFluidAmount = -1; - public double lastEnergy = -1; - public short lastProgress = -1; - private final static int height=166; - - public ElectricEvaporatorContainer(EntityPlayer entityPlayer, ElectricEvaporatorTileEntity electricEvaporatorTileEntity){ - super(electricEvaporatorTileEntity); - this.tileEntity = electricEvaporatorTileEntity; - 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(electricEvaporatorTileEntity.fuelSlot, 0, 8, 32)); - this.addSlotToContainer(new SlotInvSlot(electricEvaporatorTileEntity.fluidItemsSlot, 0, 44, 14)); - this.addSlotToContainer(new SlotInvSlot(electricEvaporatorTileEntity.emptyFluidItemsSlot, 0, 44, 32)); - this.addSlotToContainer(new SlotInvSlot(electricEvaporatorTileEntity.fillItemsSlot, 0, 44, 50)); - this.addSlotToContainer(new SlotInvSlot(electricEvaporatorTileEntity.outputSlot, 0, 117, 32)); - for(int row=0;row<=3;row++) - { - this.addSlotToContainer(new SlotInvSlot(tileEntity.upgradeSlot, row, 152, 8+row*18)); - } - - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - - if (this.tileEntity.getFluidTank().getFluid()!=null && this.tileEntity.getFluidTank().getFluidAmount() != this.lastFluidAmount) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.getFluidTank().getFluid().getFluid().getID()); - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getFluidTank().getFluidAmount()); - } - - if (this.tileEntity.getEnergy() != this.lastEnergy) - { - icrafting.sendProgressBarUpdate(this, 2, ((int)this.tileEntity.getEnergy()>>15) & Short.MAX_VALUE); - icrafting.sendProgressBarUpdate(this, 3, (short)((int)this.tileEntity.getEnergy() & Short.MAX_VALUE)); - } - - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 4, this.tileEntity.progress); - icrafting.sendProgressBarUpdate(this, 5, this.tileEntity.maxProgress); - } - } - - this.lastFluidAmount = this.tileEntity.getFluidTank().getFluidAmount(); - this.lastEnergy = this.tileEntity.getEnergy(); - this.lastProgress = this.tileEntity.progress; - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 0: - this.tileEntity.getFluidTank().setFluid(new FluidStack(FluidRegistry.getFluid(value), 1000)); - break; - case 1: - this.tileEntity.getFluidTank().setFluid(new FluidStack(this.tileEntity.getFluidTank().getFluid().getFluid(), value)); - break; - case 2: - this.tileEntity.setEnergy(value<<15); - break; - case 3: - this.tileEntity.setEnergy(this.tileEntity.getEnergy()+value); - break; - case 4: - this.tileEntity.progress=(short) value; - break; - case 5: - this.tileEntity.maxProgress=(short) value; - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/ElectricEvaporatorGui.java b/ihl/processing/chemistry/ElectricEvaporatorGui.java deleted file mode 100644 index 4a36631..0000000 --- a/ihl/processing/chemistry/ElectricEvaporatorGui.java +++ /dev/null @@ -1,85 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.util.DrawUtil; -import ic2.core.util.GuiTooltipHelper; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -@SideOnly(Side.CLIENT) -public class ElectricEvaporatorGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIElectricEvaporator.png"); - private ElectricEvaporatorContainer container; - private String title = StatCollector.translateToLocal("ihl.gui.electricEvaporator"); - - public ElectricEvaporatorGui (ElectricEvaporatorContainer electricEvaporatorContainer) { - //the container is instanciated and passed to the superclass for handling - super(electricEvaporatorContainer); - this.container=electricEvaporatorContainer; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - fontRendererObj.drawString(title, 8, 70, 6171880); - 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(9, 15 + 12 - i1, 176, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) - { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); - this.drawTexturedModalRect(99, 34, 198, 0, i1 + 1, 13); - } - - if (this.container.tileEntity.getFluidTank().getFluid()!=null && this.container.tileEntity.getFluidTank().getFluidAmount() > 0) - { - FluidStack fluidStack = this.container.tileEntity.getFluidTank().getFluid(); - if(fluidStack!=null) - { - Fluid fluid = fluidStack.getFluid(); - if(fluid!=null) - { - - IIcon fluidIcon = fluid.getIcon(); - - if (fluidIcon != null) - { - this.mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - int liquidHeight = this.container.tileEntity.gaugeLiquidScaled(47); - - DrawUtil.drawRepeated(fluidIcon, (82), 16 + 47 - liquidHeight, 12.0D, liquidHeight, this.zLevel); - this.mc.renderEngine.bindTexture(background); - } - } - String tooltip = StatCollector.translateToLocal(fluidStack.getFluid().getUnlocalizedName()) + ": " + fluidStack.amount + "mB"; - //GuiTooltiphelper.drawAreaTooltip(par1-90, par2-32, tooltip, xOffset+64, yOffset+23, xOffset+74, yOffset+71); - GuiTooltipHelper.drawAreaTooltip(par1-90, par2-32, tooltip, xOffset-8, yOffset-15, xOffset+2, yOffset+30); - } - } - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java b/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java deleted file mode 100644 index cdf3524..0000000 --- a/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java +++ /dev/null @@ -1,430 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergySink; -import ic2.api.item.IC2Items; -import ic2.api.network.INetworkTileEntityEventListener; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.IHasGui; -import ic2.core.audio.AudioSource; -import ic2.core.block.invslot.InvSlot; -import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.block.invslot.InvSlotUpgrade; -import ic2.core.upgrade.IUpgradableBlock; -import ic2.core.upgrade.IUpgradeItem; -import ic2.core.upgrade.UpgradableProperty; -import ihl.IHLMod; -import ihl.utils.IHLInvSlotDischarge; -import ihl.utils.IHLUtils; -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.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - -public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implements IEnergySink, IUpgradableBlock, INetworkTileEntityEventListener -{ - public final InvSlotUpgrade upgradeSlot; - private int tier; - public int maxStorage; - private int defaultMaxStorage; - private double energy; - public final int defaultEnergyConsume; - public final int defaultOperationLength; - public final int defaultTier; - public int energyConsume; - public AudioSource audioSource; - private int updateChecksum=0; - private boolean addedToEnergyNet=false; - - public ElectricEvaporatorTileEntity() - { - super(); - this.defaultEnergyConsume = this.energyConsume = 8; - this.defaultOperationLength = this.maxProgress = 400; - this.energy=0D; - 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); - } - - @Override - public void onLoaded() - { - super.onLoaded(); - if (IC2.platform.isSimulating()&&!this.addedToEnergyNet) - { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - this.addedToEnergyNet = true; - } - } - - @Override - public List getNetworkedFields() - { - List fields = super.getNetworkedFields(); - fields.add("tier"); - fields.add("maxStorage"); - return fields; - } - - public void setOverclockRates() - { - int speedUp=0; - int tierUp=0; - int capacityUp=0; - int checksum=0; - for(int i=0;i 1.0D) - { - double amount = ((IHLInvSlotDischarge)this.fuelSlot).discharge(this.getDemandedEnergy(), false); - this.energy += amount; - } - if (this.needsFluid()) - { - IHLUtils.handleFluidSlotsBehaviour(null, fluidItemsSlot, emptyFluidItemsSlot, fluidTank); - } - - if (this.canOperate() && this.energy >= this.energyConsume) - { - this.setActive(true); - - if (this.progress == 0) - { - IC2.network.get().initiateTileEntityEvent(this, 0, true); - } - ++this.progress; - this.energy -= this.energyConsume; - if (this.progress >= this.maxProgress) - { - 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); - } - for (int i = 0; i < this.upgradeSlot.size(); ++i) - { - ItemStack stack = this.upgradeSlot.get(i); - - if (stack != null && stack.getItem() instanceof IUpgradeItem) - { - ((IUpgradeItem)stack.getItem()).onTick(stack, this); - } - } - } - } - - @Override - public void onNetworkEvent(int event) - { - if (this.audioSource == null && this.getStartSoundFile() != null) - { - this.audioSource = IC2.audioManager.createSource(this, this.getStartSoundFile()); - } - - switch (event) - { - case 0: - if (this.audioSource != null) - { - this.audioSource.play(); - } - - break; - - case 1: - if (this.audioSource != null) - { - this.audioSource.stop(); - } - - break; - - case 2: - if (this.audioSource != null) - { - this.audioSource.stop(); - } - - } - } - - public String getStartSoundFile() - { - return "Machines/Electro Furnace/ElectroFurnaceLoop.ogg"; - } - - /** - * Returns the name of the inventory - */ - @Override - public String getInventoryName() - { - return "Electric evaporator"; - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) - { - return new ElectricEvaporatorContainer(entityPlayer, this); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) - { - return new ElectricEvaporatorGui(new ElectricEvaporatorContainer(entityPlayer, this)); - } - - @Override - public boolean getGui(EntityPlayer player) - { - return this instanceof IHasGui ? (IC2.platform.isSimulating() ? IC2.platform.launchGui(player, this) : true) : false; - } - - @Override - public int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - @Override - public int mZ() - { - switch(this.getFacing()) - { - case 2: - return -1; - case 3: - return 1; - default: - return 0; - } - } - - @Override - public double getEnergy() - { - return this.energy; - } - - @Override - public boolean useEnergy(double amount) { - if (this.energy >= amount) - { - this.energy -= amount; - return true; - } - else - { - return false; - } - } - - public void setEnergy(double i) { - this.energy=i; - } - - @Override - public double getDemandedEnergy() - { - return this.maxStorage - this.energy; - } - - @Override - public int getSinkTier() - { - return this.tier; - } - - @Override - public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) - { - if (this.energy >= this.maxStorage) - { - return amount; - } - else - { - this.energy += amount; - return 0.0D; - } - } - - @Override - public boolean acceptsEnergyFrom(TileEntity emitter, - ForgeDirection direction) { - return true; - } - - public ItemStack getOutput(int arg0) - { - return this.outputSlot.get(arg0); - } - - public int getOutputSize() { - return this.outputSlot.size(); - } - - public void setOutput(int arg0, ItemStack arg1) - { - this.outputSlot.put(arg0, arg1); - } - - @Override - public Set getUpgradableProperties() - { - Set properties = new HashSet(); - properties.add(UpgradableProperty.ItemProducing); - properties.add(UpgradableProperty.EnergyStorage); - properties.add(UpgradableProperty.Transformer); - return properties; - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/ElectrolysisBathContainer.java b/ihl/processing/chemistry/ElectrolysisBathContainer.java deleted file mode 100644 index 54bb9c7..0000000 --- a/ihl/processing/chemistry/ElectrolysisBathContainer.java +++ /dev/null @@ -1,86 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraftforge.fluids.FluidStack; - -public class ElectrolysisBathContainer extends ContainerBase { - - protected ElectrolysisBathTileEntity tileEntity; - public int lastFluidAmount = -1; - public int lastNumberOfFluids = -1; - public short lastProgress = -1; - public short lastTemperature = -1; - private final static int height=166; - public List fluidTankFluidList; - - public ElectrolysisBathContainer(EntityPlayer entityPlayer, ElectrolysisBathTileEntity tileEntity1){ - super(tileEntity1); - this.tileEntity = tileEntity1; - fluidTankFluidList = this.tileEntity.getFluidTank().getFluidList(); - 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.fillInputSlot, 0, 6, 52)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 6, 16)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 6, 33)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 98, 16)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - - if (this.tileEntity.getTankAmount() != this.lastFluidAmount || this.tileEntity.getNumberOfFluidsInTank() != this.lastNumberOfFluids) - { - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - - } - - this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); - this.lastFluidAmount = this.tileEntity.getTankAmount(); - this.lastProgress = this.tileEntity.progress; - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/ElectrolysisBathGui.java b/ihl/processing/chemistry/ElectrolysisBathGui.java deleted file mode 100644 index 404ef94..0000000 --- a/ihl/processing/chemistry/ElectrolysisBathGui.java +++ /dev/null @@ -1,100 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.IC2; -import ihl.utils.GuiMultiTextureButton; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -@SideOnly(Side.CLIENT) -public class ElectrolysisBathGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIElectrolysisBath.png"); - private ElectrolysisBathContainer container; - private GuiMultiTextureButton button1; - private int timer=10; - - public ElectrolysisBathGui (ElectrolysisBathContainer container1) { - //the container is instanciated and passed to the superclass for handling - super(container1); - this.container=container1; - } - - @SuppressWarnings("unchecked") - @Override - public void initGui() - { - super.initGui(); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - button1=new GuiMultiTextureButton(0, x+97, y+58, 18, 18, background,97,58,238,238); - this.buttonList.add(button1); - } - - @Override - public void actionPerformed(GuiButton button) - { - super.actionPerformed(button); - IC2.network.get().initiateClientTileEntityEvent(this.container.tileEntity, button.id); - if (button.id == 0) - { - button1.isActive=true; - timer=10; - } - } - - @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.progress > 0) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); - this.drawTexturedModalRect(121, 33, getFrameX(i1), getFrameY(i1),24,24); - } - if (this.container.tileEntity.getTankAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 32, 11, 89, 72, zLevel, par1, par2, xOffset, yOffset); - } - this.mc.renderEngine.bindTexture(background); - this.drawTexturedModalRect(60, 3, 252, 0,4,48); - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if(timer>0) - { - timer--; - } - if(timer==1) - { - button1.isActive=false; - } - } - - private int getFrameY(int number) - { - return (number % 10) * 24 + 14; - } - - private int getFrameX(int number) - { - return (number / 10) * 24 + 176; - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/ElectrolysisBathModel.java b/ihl/processing/chemistry/ElectrolysisBathModel.java deleted file mode 100644 index 310ec62..0000000 --- a/ihl/processing/chemistry/ElectrolysisBathModel.java +++ /dev/null @@ -1,86 +0,0 @@ -package ihl.processing.chemistry; - -// Date: 12.04.2015 13:06:31 -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ElectrolysisBathModel extends ModelBase -{ - //fields - ModelRenderer Piece1; - ModelRenderer FrontPylone; - ModelRenderer BackPylone; - ModelRenderer LeftPylone; - ModelRenderer RightPylone; - - public ElectrolysisBathModel() - { - textureWidth = 64; - textureHeight = 128; - setTextureOffset("Piece1.Stick01", 48, 4); - setTextureOffset("Piece1.Shape1", 16, 18); - setTextureOffset("Piece1.Body04", 0, 48); - setTextureOffset("Piece1.Shape2", 0, 18); - setTextureOffset("Piece1.Shape3", 16, 0); - setTextureOffset("Piece1.Shape4", 0, 0); - setTextureOffset("Piece1.Box01", 41, 18); - setTextureOffset("Piece1.Shape5", 23, 84); - setTextureOffset("Piece1.Shape6", 23, 84); - setTextureOffset("Piece1.Shape7", 23, 84); - setTextureOffset("Piece1.Shape8", 23, 83); - setTextureOffset("FrontPylone.Shape9", 23, 84); - setTextureOffset("BackPylone.Shape10", 23, 84); - setTextureOffset("LeftPylone.Shape12", 23, 84); - setTextureOffset("RightPylone.Shape11", 23, 82); - - Piece1 = new ModelRenderer(this, "Piece1"); - Piece1.setRotationPoint(0F, 16F, 0F); - setRotation(Piece1, 0F, 0F, 0F); - Piece1.mirror = false; - Piece1.addBox("Stick01", -1F, -16F, -1F, 2, 9, 2); - Piece1.addBox("Shape1", -8F, -8F, -8F, 2, 16, 14); - Piece1.addBox("Body04", -6F, -7F, -6F, 12, 15, 12); - Piece1.addBox("Shape2", 6F, -8F, -6F, 2, 16, 14); - Piece1.addBox("Shape3", -6F, -8F, -8F, 14, 16, 2); - Piece1.addBox("Shape4", -8F, -8F, 6F, 14, 16, 2); - Piece1.addBox("Box01", -2F, -13F, -2F, 4, 2, 4); - Piece1.addBox("Shape5", 5F, -9F, -1.5F, 2, 2, 3); - Piece1.addBox("Shape6", -7F, -9F, -1.5F, 2, 2, 3); - Piece1.addBox("Shape7", -1.5F, -9F, 5F, 3, 2, 2); - Piece1.addBox("Shape8", -1.5F, -9F, -7F, 3, 2, 2); - FrontPylone = new ModelRenderer(this, "FrontPylone"); - FrontPylone.setRotationPoint(0F, 7F, -5F); - setRotation(FrontPylone, -0.9F, 0F, 0); - FrontPylone.mirror = true; - FrontPylone.addBox("Shape9", -1F, -5F, -1F, 2, 6, 1); - BackPylone = new ModelRenderer(this, "BackPylone"); - BackPylone.setRotationPoint(0F, 7F, 5F); - setRotation(BackPylone, 0.9F, 0F, 0F); - BackPylone.mirror = true; - BackPylone.addBox("Shape10", -1F, -5F, 0F, 2, 6, 1); - LeftPylone = new ModelRenderer(this, "LeftPylone"); - LeftPylone.setRotationPoint(5F, 7F, 0F); - setRotation(LeftPylone, 0F, 0F, -0.9F); - LeftPylone.mirror = true; - LeftPylone.addBox("Shape12", 0F, -5F, -1F, 1, 6, 2); - RightPylone = new ModelRenderer(this, "RightPylone"); - RightPylone.setRotationPoint(-5F, 7F, 0F); - setRotation(RightPylone, 0, 0F, 0.9F); - RightPylone.mirror = true; - RightPylone.addBox("Shape11", -1F, -5F, -1F, 1, 6, 2); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java b/ihl/processing/chemistry/ElectrolysisBathTileEntity.java deleted file mode 100644 index f4743df..0000000 --- a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java +++ /dev/null @@ -1,297 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.network.INetworkClientTileEntityEventListener; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.IHasGui; -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 ihl.flexible_cable.FlexibleCableHolderBaseTileEntity; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntity implements IHasGui, INetworkClientTileEntityEventListener, IFluidHandler -{ - private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("electrolysisbath"); - public final ApparatusProcessableInvSlot input; - public final InvSlotConsumableLiquidIHL drainInputSlot; - public final InvSlotConsumableLiquidIHL fillInputSlot; - public final InvSlotOutput emptyFluidItemsSlot; - public short progress; - protected short operationLength=20000;//Short.MAX_VALUE=32767 - private final IHLFluidTank fluidTank = new IHLFluidTank(2000); - private final static double resistance=5D; - - public ElectrolysisBathTileEntity() { - super(); - 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.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 1, 64); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankTag = new NBTTagCompound(); - this.fluidTank.writeToNBT(fluidTankTag); - nbttagcompound.setTag("fluidTank", fluidTankTag); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return false; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("electrolysisBath"); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - if (this.canOperate()) - { - this.setActive(true); - if (this.progress == 0) - { - IC2.network.get().initiateTileEntityEvent(this, 0, true); - } - if(gridID!=-1 && this.getGrid().energy>0D) - { - double drawEnergy = getEnergyAmountThisNodeWant(); - this.progress+=drawEnergy; - this.getGrid().drawEnergy(drawEnergy, this); - } - - 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 FluidStack drain(ForgeDirection from, int amount, boolean doDrain) - { - FluidStack fstack = this.fluidTank.drain(amount, doDrain); - return fstack; - } - - - //1.7.10 API - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return true; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return true; - } - - @Override - public String getInventoryName() { - return "Electrolysis bath"; - } - - @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - TileEntity te = worldObj.getTileEntity(xCoord, yCoord-1, zCoord); - if(te instanceof IFluidHandler && this.fluidTank.getFluid()!=null) - { - IFluidHandler ifhte = (IFluidHandler)te; - if(ifhte.canFill(ForgeDirection.UP, this.fluidTank.getFluid().getFluid())) - { - int filled = ifhte.fill(ForgeDirection.UP, this.fluidTank.drain(this.getTankAmount(), false), true); - this.fluidTank.drain(filled, true); - } - } - } - - public int gaugeProgressScaled(int i) - { - return this.progress * i / operationLength; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new ElectrolysisBathGui(new ElectrolysisBathContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) - { - this.fluidTank.sortFluidsByDensity(); - return new ElectrolysisBathContainer(player, this); - } - - @Override - public void onGuiClosed(EntityPlayer player) {} - - public boolean canOperate() - { - return getOutput()!=null; - } - - public UniversalRecipeOutput getOutput() - { - return ElectrolysisBathTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @SuppressWarnings("rawtypes") - public List[] getInput() - { - for(int i=0;i getRecipes() { - return recipeManager.getRecipes(); - } - - public IHLFluidTank getFluidTank() - { - return this.fluidTank; - } - - @Override - public double getMaxAllowableVoltage() - { - return 64000D; - } - - @Override - public double getEnergyAmountThisNodeWant() - { - double voltage = this.getGrid().getSinkVoltage(this); - double energy = voltage*voltage/resistance; - return this.getOutput()!=null?energy>1d?energy:1d:0d; - } - - @Override - public void injectEnergyInThisNode(double amount, double voltage) - { - this.progress+=amount; - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/EvaporatorBlock.java b/ihl/processing/chemistry/EvaporatorBlock.java deleted file mode 100644 index 6994176..0000000 --- a/ihl/processing/chemistry/EvaporatorBlock.java +++ /dev/null @@ -1,221 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Random; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.IHLCreativeTab; -import ihl.IHLModInfo; -import net.minecraft.block.Block; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -public class EvaporatorBlock extends Block implements ITileEntityProvider{ - - IIcon textureFrontActive, textureSide, textureBottom, textureTop; - - public EvaporatorBlock(Material material) - { - super(material); - this.setCreativeTab(IHLCreativeTab.tab); - } - - @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) - { - return new ItemStack(Blocks.furnace,1).getItem(); - } - - @Override - public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) - { - ItemStack result = new ItemStack(Blocks.furnace,1); - this.dropBlockAsItem(world, x, y, z, result); - } - - @Override - public TileEntity createNewTileEntity(World world, int var2) { - return new EvaporatorTileEntity(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorFront"); - this.textureFrontActive = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorFrontActive"); - this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorSide"); - this.textureTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorTop"); - this.textureBottom = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorBottom"); - } - - @Override - public boolean hasTileEntity(int metadata) - { - return true; - } - - @Override - public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer entityPlayer,int i,float pos_x,float pos_y,float pos_z){ - TileEntity te = world.getTileEntity(x,y,z); - if(te instanceof EvaporatorTileEntity) - { - EvaporatorTileEntity bte = (EvaporatorTileEntity)te; - if (bte == null || entityPlayer.isSneaking()) { - return false; - } - else - { - return bte.getGui(entityPlayer); - } - } - return false; - } - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) - { - int var7 = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - TileEntity t = world.getTileEntity(x, y, z); - if(t!=null && t instanceof EvaporatorTileEntity) - { - EvaporatorTileEntity te = (EvaporatorTileEntity)t; - if(player.isSneaking()) - { - switch(var7) - { - case 0: - te.setFacing((short) 3); - break; - case 1: - te.setFacing((short) 4); - break; - case 2: - te.setFacing((short) 2); - break; - case 3: - te.setFacing((short) 5); - break; - default: - break; - } - } - else - { - switch(var7) - { - case 0: - te.setFacing((short) 2); - break; - case 1: - te.setFacing((short) 5); - break; - case 2: - te.setFacing((short) 3); - break; - case 3: - te.setFacing((short) 4); - break; - default: - break; - } - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) - { - IIcon faceIcon=this.blockIcon; - int facing=3; - int mask[] = { - 0,1,2,3,4,5, - 1,0,3,2,4,5, - 2,3,0,1,4,5, - 2,3,1,0,4,5, - 2,3,5,4,0,1, - 2,3,4,5,1,0 - }; - TileEntity te = world.getTileEntity(x, y, z); - if(te!=null) - { - EvaporatorTileEntity tebh = (EvaporatorTileEntity) te; - facing=tebh.getFacing(); - if(tebh.getActive()) - { - faceIcon=this.textureFrontActive; - } - } - - switch (mask[facing*6+side]) - { - case 0: - return faceIcon; - case 1: - return this.textureSide; - case 2: - return this.textureBottom; - case 3: - return this.textureTop; - case 4: - return this.textureSide; - case 5: - return this.textureSide; - default: - return this.textureSide; - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) - { - switch (side) - { - case 0: - return this.textureTop; - case 1: - return this.textureBottom; - case 2: - return this.textureSide; - case 3: - return this.blockIcon; - case 4: - return this.textureSide; - case 5: - return this.textureSide; - default: - return this.textureSide; - } - } - - @Override - public void randomDisplayTick(World world, int x, int y, int z, Random random) - { - TileEntity te = world.getTileEntity(x, y, z); - if(te instanceof EvaporatorTileEntity) - { - EvaporatorTileEntity ete = (EvaporatorTileEntity) te; - if(ete.getActive()) - { - world.spawnParticle("snowshovel", x+0.2D, y+1.2D, z+0.2D, 0D, 0.05D, 0D); - world.spawnParticle("flame", x+0.5D+ete.mX()*0.5D+(random.nextDouble()*0.4D-0.2D)*ete.mZ(), y+random.nextDouble()*0.25D, z+0.5D+ete.mZ()*0.5D+(random.nextDouble()*0.4D-0.2D)*ete.mX(), 0D, 0.01D, 0D); - } - } - } -} diff --git a/ihl/processing/chemistry/EvaporatorContainer.java b/ihl/processing/chemistry/EvaporatorContainer.java deleted file mode 100644 index cb83269..0000000 --- a/ihl/processing/chemistry/EvaporatorContainer.java +++ /dev/null @@ -1,100 +0,0 @@ -package ihl.processing.chemistry; - -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; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class EvaporatorContainer extends ContainerBase { - - protected EvaporatorTileEntity tileEntity; - public int lastFluidAmount = -1; - public int lastFuel = -1; - public short lastProgress = -1; - private final static int height=166; - - public EvaporatorContainer(EntityPlayer entityPlayer, EvaporatorTileEntity tileEntity1){ - super(tileEntity1); - this.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.fuelSlot, 0, 8, 32)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fluidItemsSlot, 0, 44, 14)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 44, 32)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillItemsSlot, 0, 44, 50)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 117, 32)); - - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - - if (this.tileEntity.getFluidTank().getFluid()!=null && this.tileEntity.getFluidTank().getFluidAmount() != this.lastFluidAmount) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.getFluidTank().getFluid().getFluid().getID()); - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getFluidTank().getFluidAmount()); - } - - if (this.tileEntity.fuel != this.lastFuel) - { - icrafting.sendProgressBarUpdate(this, 2, this.tileEntity.fuel); - } - - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 3, this.tileEntity.progress); - } - } - - this.lastFluidAmount = this.tileEntity.getFluidTank().getFluidAmount(); - this.lastFuel = this.tileEntity.fuel; - this.lastProgress = this.tileEntity.progress; - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 0: - this.tileEntity.getFluidTank().setFluid(new FluidStack(FluidRegistry.getFluid(value), 1000)); - break; - case 1: - this.tileEntity.getFluidTank().setFluid(new FluidStack(this.tileEntity.getFluidTank().getFluid().getFluid(), value)); - break; - case 2: - this.tileEntity.fuel=value; - break; - case 3: - this.tileEntity.progress=(short) value; - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/EvaporatorGui.java b/ihl/processing/chemistry/EvaporatorGui.java deleted file mode 100644 index 05f7c31..0000000 --- a/ihl/processing/chemistry/EvaporatorGui.java +++ /dev/null @@ -1,84 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.util.DrawUtil; -import ic2.core.util.GuiTooltipHelper; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -@SideOnly(Side.CLIENT) -public class EvaporatorGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUISolidFuelEvaporator.png"); - private EvaporatorContainer container; - private String title = StatCollector.translateToLocal("ihl.gui.evaporator"); - - - public EvaporatorGui (EvaporatorContainer container1) { - //the container is instanciated and passed to the superclass for handling - super(container1); - this.container=container1; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - fontRendererObj.drawString(title, 8, 70, 6171880); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); - int i1; - if (this.container.tileEntity.fuel > 0) - { - i1 = Math.min(this.container.tileEntity.gaugeFuelScaled(12),12); - this.drawTexturedModalRect(9, 16 + 12 - i1, 176, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) - { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); - this.drawTexturedModalRect(99, 34, 198, 0, i1 + 1, 13); - } - - if (this.container.tileEntity.getTankAmount() > 0) - { - FluidStack fluidStack = this.container.tileEntity.getFluidTank().getFluid(); - if(fluidStack!=null) - { - Fluid fluid = fluidStack.getFluid(); - if(fluid!=null) - { - - IIcon fluidIcon = fluid.getIcon(); - - if (fluidIcon != null) - { - this.mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - int liquidHeight = this.container.tileEntity.gaugeLiquidScaled(47); - DrawUtil.drawRepeated(fluidIcon, (82), 16 + 47 - liquidHeight, 12.0D, liquidHeight, this.zLevel); - this.mc.renderEngine.bindTexture(background); - } - } - String tooltip = StatCollector.translateToLocal(fluidStack.getFluid().getUnlocalizedName()) + ": " + fluidStack.amount + "mB"; - GuiTooltipHelper.drawAreaTooltip(par1-90, par2-32, tooltip, xOffset-8, yOffset-15, xOffset+2, yOffset+30); - } - } - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/EvaporatorTileEntity.java b/ihl/processing/chemistry/EvaporatorTileEntity.java deleted file mode 100644 index 279fa17..0000000 --- a/ihl/processing/chemistry/EvaporatorTileEntity.java +++ /dev/null @@ -1,290 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Arrays; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.item.IC2Items; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.IHasGui; -import ic2.core.block.TileEntityLiquidTankInventory; -import ic2.core.block.invslot.InvSlot; -import ic2.core.block.invslot.InvSlotConsumableFuel; -import ic2.core.block.invslot.InvSlotConsumableLiquid; -import ic2.core.block.invslot.InvSlotOutput; -import ihl.IHLMod; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -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.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implements IHasGui -{ - public final IHLInvSlotOutput outputSlot; - public InvSlot fuelSlot; - public final InvSlotConsumableLiquidIHL fluidItemsSlot; - public final InvSlotConsumableLiquidIHL fillItemsSlot; - public final InvSlotOutput emptyFluidItemsSlot; - - public short progress = 0; - public short maxProgress = 450; - public int fuel = 0; - public int maxFuel = 0; - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("evaporator"); - - public EvaporatorTileEntity() - { - super(8); - this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); - this.fuelSlot = new InvSlotConsumableFuel(this, "fuel", 1, 1, true); - this.fluidItemsSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", 2, InvSlot.Access.I, 1, InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Drain); - this.fillItemsSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", 4, InvSlot.Access.I, 1, InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Fill); - this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 3, 1); - } - - public static void init() - { - addRecipe(new FluidStack(FluidRegistry.getFluid("fluidrubbertreesap"),200), IC2Items.getItem("resin")); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - - try - { - this.fuel = nbttagcompound.getInteger("fuel"); - } - catch (Throwable var4) - { - this.fuel = nbttagcompound.getShort("fuel"); - } - - try - { - this.maxFuel = nbttagcompound.getInteger("maxFuel"); - } - catch (Throwable var3) - { - this.maxFuel = nbttagcompound.getShort("maxFuel"); - } - - this.progress = nbttagcompound.getShort("progress"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - nbttagcompound.setInteger("fuel", this.fuel); - nbttagcompound.setInteger("maxFuel", this.maxFuel); - nbttagcompound.setShort("progress", this.progress); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=(short)side && side!=0 && side!=1; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - if(this.outputSlot.get()!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.outputSlot.get())); - if(this.fuelSlot.get()!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.fuelSlot.get())); - if(this.emptyFluidItemsSlot.get()!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.emptyFluidItemsSlot.get())); - return new ItemStack(IHLMod.evaporatorBlock,1); - } - - public int gaugeProgressScaled(int i) - { - return this.progress * i / maxProgress; - } - - public int gaugeFuelScaled(int i) - { - if (this.maxFuel == 0) - { - this.maxFuel = this.fuel; - - if (this.maxFuel == 0) - { - this.maxFuel = 160; - } - } - - return this.fuel * i / this.maxFuel; - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - if (this.needsFluid()) - { - IHLUtils.handleFluidSlotsBehaviour(fillItemsSlot, fluidItemsSlot, emptyFluidItemsSlot, fluidTank); - } - if (this.fuel <= 0 && this.canOperate() && this.fuelSlot instanceof InvSlotConsumableFuel) - { - this.fuel = this.maxFuel = ((InvSlotConsumableFuel) this.fuelSlot).consumeFuel(); - } - - if (this.isBurning() && this.canOperate()) - { - ++this.progress; - - if (this.progress >= maxProgress) - { - this.progress = 0; - this.operate(); - } - } - else - { - this.progress = 0; - } - - if (this.fuel > 0) - { - --this.fuel; - } - - if (this.getActive() != this.isBurning()) - { - this.setActive(this.isBurning()); - } - } - - public void operate() - { - UniversalRecipeOutput output = this.getOutput(); - if(output!=null && !output.getItemOutputs().isEmpty()) - { - this.outputSlot.add(this.getOutput().getItemOutputs().get(0).copy()); - } - this.fluidTank.drain(recipeManager.getRecipeInput(Arrays.asList(new FluidStack [] {this.fluidTank.getFluid()}),null).getFluidInputs().get(0).getAmount(), true); - } - - public boolean isBurning() - { - return this.fuel > 0; - } - - public boolean canOperate() - { - if (this.fluidTank.getFluid()==null) - { - return false; - } - else - { - UniversalRecipeOutput output = recipeManager.getOutputFor(Arrays.asList(new FluidStack [] {this.fluidTank.getFluid()}),null); - return output == null ? false : (this.outputSlot.canAdd(output.getItemOutputs()) ? true : false); - } - } - - /** - * Returns the name of the inventory - */ - @Override - public String getInventoryName() - { - return "Solid fuel evaporator"; - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) - { - return new EvaporatorContainer(entityPlayer, this); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) - { - return new EvaporatorGui(new EvaporatorContainer(entityPlayer, this)); - } - - @Override - public void onGuiClosed(EntityPlayer entityPlayer) {} - - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return false; - } - - @Override - public boolean canFill(ForgeDirection arg0, Fluid fluid1) { - return true; - } - - public boolean getGui(EntityPlayer player) - { - return this instanceof IHasGui ? (IC2.platform.isSimulating() ? IC2.platform.launchGui(player, this) : true) : false; - } - - public int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - public int mZ() - { - switch(this.getFacing()) - { - case 2: - return -1; - case 3: - return 1; - default: - return 0; - } - } - - public static void addRecipe(FluidStack input, ItemStack output) - { - recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack [] {input}),null), new UniversalRecipeOutput(null, (new ItemStack[] {output}),20)); - } - - public UniversalRecipeOutput getOutput() - { - if (this.fluidTank.getFluid()==null) - { - return null; - } - else - { - UniversalRecipeOutput output = recipeManager.getOutputFor(Arrays.asList(new FluidStack [] {this.fluidTank.getFluid()}),null); - return output == null ? null : (this.outputSlot.canAdd(output.getItemOutputs()) ? output : null); - } - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/ExtruderModel.java b/ihl/processing/chemistry/ExtruderModel.java deleted file mode 100644 index 4d4688a..0000000 --- a/ihl/processing/chemistry/ExtruderModel.java +++ /dev/null @@ -1,100 +0,0 @@ -package ihl.processing.chemistry; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class ExtruderModel extends ModelBase -{ - //fields - IHLModelRenderer Base; - IHLModelRenderer RotatingPart2; - IHLModelRenderer MotorPart1; - IHLModelRenderer MotorPart2; - IHLModelRenderer Belt; - IHLModelRenderer Belt2; - IHLModelRenderer Extruder; - - public ExtruderModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 0); - setTextureOffset("Base.Shape3", 0, 0); - setTextureOffset("Base.Shape16", 0, 0); - setTextureOffset("RotatingPart2.PipeN7", 49, 23); - setTextureOffset("RotatingPart2.PipeN4", 0, 7); - setTextureOffset("MotorPart1.PipeN41", 0, 0); - setTextureOffset("MotorPart1.PipeN12", 0, 0); - setTextureOffset("MotorPart1.PipeN13", 0, 0); - setTextureOffset("MotorPart2.Shape4", 0, 24); - setTextureOffset("MotorPart2.Shape7", 0, 9); - setTextureOffset("MotorPart2.Shape10", 0, 9); - setTextureOffset("Belt.Shape12", 0, 0); - setTextureOffset("Belt2.Shape13", 0, 0); - setTextureOffset("Extruder.PipeN16", 0, 0); - setTextureOffset("Extruder.PipeN15", 24, 20); - setTextureOffset("Extruder.Shape8", 0, 0); - setTextureOffset("Extruder.PipeU17", 0, 0); - setTextureOffset("Extruder.PipeUC18", 0, 0); - setTextureOffset("Extruder.Shape14", 0, 0); - setTextureOffset("Extruder.PipeN14", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); - Base.addBox("Shape3", -5F, 0F, -7F, 4, 7, 1); - Base.addBox("Shape16", 3F, 3F, -6F, 3, 4, 1); - RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); - RotatingPart2.setRotationPoint(-3F, 18F, -7F); - setRotation(RotatingPart2, 0F, 0F, 0F); - RotatingPart2.mirror = true; - RotatingPart2.addTube("PipeN7", -2.5F, -2.5F, -1F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN4", -1F, -1F, 1F, 2, 2, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); - MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); - setRotation(MotorPart1, 0F, 0F, 0F); - MotorPart1.mirror = true; - MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); - MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); - MotorPart2.setRotationPoint(0F, 16F, 0F); - setRotation(MotorPart2, 0F, 0F, 0F); - MotorPart2.mirror = true; - MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); - MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); - MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); - Belt = new IHLModelRenderer(this, "Belt"); - Belt.setRotationPoint(-3F, 15.5F, -7.9F); - setRotation(Belt, 0F, 0F, 0.45F); - Belt.mirror = true; - Belt.addBox("Shape12", 0.5F, 0F, 0F, 8, 1, 1); - Belt2 = new IHLModelRenderer(this, "Belt2"); - Belt2.setRotationPoint(-3F, 19.5F, -7.9F); - setRotation(Belt2, 0F, 0F, 0.19F); - Belt2.mirror = true; - Belt2.addBox("Shape13", 0F, 0F, 0F, 8, 1, 1); - Extruder = new IHLModelRenderer(this, "Extruder"); - Extruder.setRotationPoint(0F, 16F, 0F); - setRotation(Extruder, 0F, 0F, 0F); - Extruder.mirror = true; - Extruder.addTube("PipeN16", -4.5F, 0.5F, -5F, 3, 3, 12, 0F,1F,ForgeDirection.NORTH); - Extruder.addTube("PipeN15", -5.5F, -0.5F, 0F, 5, 5, 7, 0.5F,1F,ForgeDirection.NORTH); - Extruder.addBox("Shape8", -5F, 4F, 6.9F, 4, 3, 1); - Extruder.addTube("PipeU17", -5.5F, -8F, -5F, 5, 8, 5, 0.8F,1F,ForgeDirection.UP); - Extruder.addTube("PipeUC18", -5.5F, 0F, -5F, 5, 2, 5, 0.8F,0.6F,ForgeDirection.UP); - Extruder.addBox("Shape14", -5F, 3F, -4.9F, 4, 4, 1); - Extruder.addTube("PipeN14", -5.5F, -0.5F, 7F, 5, 5, 1, 0.5F,1F,ForgeDirection.NORTH); - } - - 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/chemistry/FluidizedBedReactorContainer.java b/ihl/processing/chemistry/FluidizedBedReactorContainer.java deleted file mode 100644 index 8b7aa47..0000000 --- a/ihl/processing/chemistry/FluidizedBedReactorContainer.java +++ /dev/null @@ -1,44 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fluids.FluidStack; - -public class FluidizedBedReactorContainer extends BasicElectricMotorContainer { - - protected FluidizedBedReactorTileEntity tileEntity; - public int lastFluidsHash = -1; - private final static int height=166; - public List fluidTankFluidList; - - public FluidizedBedReactorContainer(EntityPlayer entityPlayer, FluidizedBedReactorTileEntity tileEntity1){ - super(entityPlayer, tileEntity1); - this.tileEntity = tileEntity1; - fluidTankFluidList = this.tileEntity.getFluidTank().getFluidList(); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 102, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 102, 15)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 102, 33)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 41, 23)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 41, 41)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 76, 33)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - if (fluidTankFluidList.hashCode() != this.lastFluidsHash) - { - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - this.lastFluidsHash = fluidTankFluidList.hashCode(); - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/FluidizedBedReactorGui.java b/ihl/processing/chemistry/FluidizedBedReactorGui.java deleted file mode 100644 index 95ba8f0..0000000 --- a/ihl/processing/chemistry/FluidizedBedReactorGui.java +++ /dev/null @@ -1,59 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -@SideOnly(Side.CLIENT) -public class FluidizedBedReactorGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", - "textures/gui/GUIFluidizedBedReactor.png"); - private FluidizedBedReactorContainer container; - private int mixerFrame = 0; - - public FluidizedBedReactorGui(FluidizedBedReactorContainer container1) { - // the container is instanciated and passed to the superclass for - // handling - super(container1); - this.container = container1; - } - - @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(12, 16 + 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(58, 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 - 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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java b/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java deleted file mode 100644 index 4961fc6..0000000 --- a/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java +++ /dev/null @@ -1,312 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -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 ihl.processing.invslots.IHLInvSlotOutput; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.processing.metallurgy.BasicElectricMotorTileEntity; -import ihl.recipes.RecipeOutputItemStack; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler -{ - private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("fluidizedbedreactor"); - public final ApparatusProcessableInvSlot input; - public final IHLInvSlotOutput outputSlot; - public final InvSlotConsumableLiquidIHL drainInputSlot; - public final InvSlotConsumableLiquidIHL fillInputSlot; - public final InvSlotOutput emptyFluidItemsSlot; - private final IHLFluidTank fluidTank = new IHLFluidTank(8000); - public short temperature=20; - - public FluidizedBedReactorTileEntity() { - super(); - this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); - 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.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 2, 64); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankTag = new NBTTagCompound(); - this.fluidTank.writeToNBT(fluidTankTag); - nbttagcompound.setTag("fluidTank", fluidTankTag); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=side; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("fluidizedBedReactor"); - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - } - - @Override - public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) - { - switch(from) - { - case UP: - return this.fluidTank.drainLightest(amount, doDrain); - case NORTH: - return this.fluidTank.drainLightest(amount, doDrain); - case SOUTH: - return this.fluidTank.drainLightest(amount, doDrain); - case WEST: - return this.fluidTank.drainLightest(amount, doDrain); - case EAST: - return this.fluidTank.drainLightest(amount, doDrain); - case DOWN: - return this.fluidTank.drain(amount, doDrain); - default: - return this.fluidTank.drain(amount, doDrain); - } - } - - - //1.7.10 API - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return true; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return true; - } - - @Override - public String getInventoryName() { - return "fluidizedBedReactor"; - } - - @Override - public int gaugeProgressScaled(int i) - { - return this.progress * i / operationLength; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new FluidizedBedReactorGui(new FluidizedBedReactorContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) - { - this.fluidTank.sortFluidsByDensity(); - return new FluidizedBedReactorContainer(player, this); - } - - @Override - public void onGuiClosed(EntityPlayer player) {} - - @Override - public boolean canOperate() - { - UniversalRecipeOutput output = getOutput(); - if(output!=null && this.outputSlot.canAdd(getOutput().getItemOutputs())) - { - if(output.specialConditions) - { - return this.checkSpecialConditions(); - } - else - { - return true; - } - } - 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 FluidizedBedReactorTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public List[] getInput() - { - for(int i=0;i1000) - { - this.input.consume(recipeInput.getItemInputs().get(0)); - } - } - if(recipeInput.getItemInputs().size()>1)this.input.consume(recipeInput.getItemInputs().get(1)); - 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); - if(!output1.getItemOutputs().isEmpty() && output1.getItemOutputs().get(0)!=null)this.outputSlot.add(output1.getItemOutputs()); - - } - - @Override - public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { - if(fluidTank.getFluid()!=null && fluidTank.getFluid().containsFluid(fluidStack)) - { - return this.fluidTank.drain(fluidStack, doDrain); - } - return null; - } - - @Override - public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return this.fluidTank.fill(arg1, arg2); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { - return new FluidTankInfo[] {this.fluidTank.getInfo()}; - } - - public boolean needsFluid() - { - return this.fluidTank.getFluidAmount() <= this.fluidTank.getCapacity(); - } - - public FluidStack getFluidStackfromTank() - { - return this.fluidTank.getFluid(); - } - - public int getTankAmount() - { - return this.fluidTank.getFluidAmount(); - } - - public int gaugeLiquidScaled(int i, int index) - { - return this.fluidTank.getFluidAmount() <= 0 ? 0 : this.fluidTank.getFluidAmount(index) * i / this.fluidTank.getCapacity(); - } - public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) - { - recipeManager.addRecipe(input, output); - } - - public int getNumberOfFluidsInTank() - { - return this.fluidTank.getNumberOfFluids(); - } - - public static Map getRecipes() - { - return recipeManager.getRecipes(); - } - - public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1) - { - if(fluidStackOutput!=null) - { - addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1}),200)); - } - else - { - addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new ItemStack[] {itemStackOutput1}),200)); - } - } - - public IHLFluidTank getFluidTank() - { - return this.fluidTank; - } - - public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackInput, FluidStack fluidStackOutput, RecipeOutputItemStack itemStackOutput1) { - if(fluidStackOutput!=null) - { - addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new RecipeOutputItemStack[] {itemStackOutput1}),200)); - } - else - { - addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new RecipeOutputItemStack[] {itemStackOutput1}),200)); - } - } - -} \ No newline at end of file diff --git a/ihl/processing/chemistry/FractionatorBottomModel.java b/ihl/processing/chemistry/FractionatorBottomModel.java deleted file mode 100644 index c395af7..0000000 --- a/ihl/processing/chemistry/FractionatorBottomModel.java +++ /dev/null @@ -1,48 +0,0 @@ -// Date: 05.04.2015 16:55:22 -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package ihl.processing.chemistry; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class FractionatorBottomModel extends ModelBase -{ - //fields - IHLModelRenderer Base; - - public FractionatorBottomModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Box03", 0, 0); - setTextureOffset("Base.Box04", 0, 0); - setTextureOffset("Base.Pipeup02", 0, 0); - setTextureOffset("Base.WestPipe03", 0, 0); - setTextureOffset("Base.WestPipe04", 0, 0); - setTextureOffset("Base.PipeUp05", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Box03", 2F, -7.1F, -8F, 6, 15, 16); - Base.addBox("Box04", -8F, 7F, -8F, 16, 1, 16); - Base.addTube("Pipeup02", -8F, -8F, -8F, 16, 1, 16, 0.8F, 1.0F, ForgeDirection.UP); - Base.addTube("WestPipe03", -7.5F, -1.5F, -1.5F, 3, 3, 3, 0.8F, 1.0F, ForgeDirection.WEST); - Base.addTube("WestPipe04", -8F, -2F, -2F, 1, 4, 4, 0.8F, 1.0F, ForgeDirection.WEST); - Base.addTube("PipeUp05", -7F, -7F, -7F, 14, 15, 14, 0.8F, 1.0F, ForgeDirection.UP); - } - - 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/chemistry/FractionatorBottomTileEntity.java b/ihl/processing/chemistry/FractionatorBottomTileEntity.java deleted file mode 100644 index 3d9e95e..0000000 --- a/ihl/processing/chemistry/FractionatorBottomTileEntity.java +++ /dev/null @@ -1,352 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import ic2.api.energy.tile.IHeatSource; -import ic2.core.IC2; -import ic2.core.block.TileEntityInventory; -import ihl.recipes.IRecipeInputFluid; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -import ihl.worldgen.ores.IHLFluid; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class FractionatorBottomTileEntity extends TileEntityInventory implements IFluidHandler -{ - private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("fractionator"); - private static float kF = 24000F; - private static float fluidC = 4F; - private static float H = 2256F; - private final IHLFluidTank waterTank = new IHLFluidTank(100); - private final IHLFluidTank fluidTank = new IHLFluidTank(8000); - private int amountOfGasCondensed=0; - private int amountOfFluidEvaporated=0; - private int systemHeat=0; - private static final int maxSystemHeat=10000; - private final List listOfColumnSections = new ArrayList(); - private FractionatorCoverTileEntity columnCover; - private RefluxCondenserTileEntity refluxCondenser; - private IHeatSource heatSource; - private int fluxRecirculationProportion=10; - - public FractionatorBottomTileEntity() - { - super(); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); - this.waterTank.readFromNBT(nbttagcompound.getCompoundTag("waterTank")); - this.amountOfGasCondensed=nbttagcompound.getInteger("amountOfGasCondensed"); - this.systemHeat=nbttagcompound.getInteger("systemHeat"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankTag = new NBTTagCompound(); - this.fluidTank.writeToNBT(fluidTankTag); - nbttagcompound.setTag("fluidTank", fluidTankTag); - - NBTTagCompound waterTankTag = new NBTTagCompound(); - this.waterTank.writeToNBT(waterTankTag); - nbttagcompound.setTag("waterTank", waterTankTag); - - nbttagcompound.setInteger("amountOfGasCondensed",this.amountOfGasCondensed); - nbttagcompound.setInteger("systemHeat",this.systemHeat); - - } - - public static void addRecipe(FluidStack fluidIn, FluidStack fluidOut1, FluidStack fluidOut2) - { - recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidIn}), null), new UniversalRecipeOutput((new FluidStack[] {fluidOut1,fluidOut2}),null,2)); - } - - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=(short)side && side!=0 && side!=1; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("fractionatorBottom"); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - if(!this.checkIntegrity()) - { - return; - } - this.fluxRecirculationProportion=100-10000/(100+this.listOfColumnSections.size()*3); - ForgeDirection orientation = ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP); - if(systemHeat < maxSystemHeat && this.checkHeatSource(orientation)) - { - systemHeat+=this.heatSource.requestHeat(orientation.getOpposite(), Integer.MAX_VALUE); - } - FluidStack fsCurrentInput = this.fluidTank.getFluid(); - if(fsCurrentInput!=null && fsCurrentInput.amount>100 && systemHeat>0) - { - UniversalRecipeOutput rOutput = FractionatorBottomTileEntity.recipeManager.getOutputFor(this.fluidTank.getFluidList(),null); - UniversalRecipeInput rInput = FractionatorBottomTileEntity.recipeManager.getRecipeInput(this.fluidTank.getFluidList(),null); - if(rOutput!=null) - { - IRecipeInputFluid input = rInput.getFluidInputs().get(0); - int rInputAmount = input.getAmount(); - FluidStack result1=rOutput.getFluidOutputs().get(0).copy(); - FluidStack result2=rOutput.getFluidOutputs().get(1).copy(); - //max heat per tick of electric heater is 100 - int amountOfFluidToEvaporate = Math.min(fsCurrentInput.amount*result2.amount/rInputAmount,systemHeat/100); - systemHeat-=amountOfFluidToEvaporate*100; - amountOfFluidEvaporated+=amountOfFluidToEvaporate; - int amountOfVapours=amountOfFluidEvaporated*50; - FluidStack coolant = this.waterTank.getFluid(); - if(coolant!=null && coolant.amount>0) - { - int amountOfGasToCondense = Math.min(coolant.amount*50, amountOfVapours); - amountOfGasCondensed += amountOfGasToCondense; - amountOfFluidEvaporated -= amountOfGasToCondense/50; - } - if(amountOfGasCondensed>10000) - { - int amountToProcess=amountOfGasCondensed*this.fluxRecirculationProportion/5000;//only 10% of condensate will be extracted. - int amount = rInputAmount * amountToProcess / result2.amount; - result1.amount = result1.amount* amountToProcess / result2.amount; - result2.amount = amountToProcess; - this.fluidTank.drain(input,amount, true); - this.fillVatResidueOutputApparatus(orientation.getOpposite(), result1, true); - this.fillCondensateOutputApparatus(ForgeDirection.UP, result2, true); - amountOfGasCondensed=0; - } - } - } - if(this.waterTank.getFluid()!=null) - { - FluidStack coolant = this.waterTank.drain(5, true); - this.fillHeatTransferAgentOutputApparatus(ForgeDirection.UP, coolant, true); - } - } - - - private boolean checkHeatSource(ForgeDirection orientation) - { - if(this.heatSource!=null) - { - return true; - } - else - { - TileEntity te = worldObj.getTileEntity(xCoord+orientation.offsetX, yCoord, zCoord+orientation.offsetZ); - if(te instanceof IHeatSource) - { - if(((IHeatSource)te).maxrequestHeatTick(orientation.getOpposite())>0) - { - this.heatSource=(IHeatSource)te; - return true; - } - } - } - return false; - } - - private boolean checkIntegrity() - { - boolean allright=true; - if(!this.listOfColumnSections.isEmpty() && - this.columnCover!=null && - !this.columnCover.isInvalid() && - this.refluxCondenser!=null && - !this.refluxCondenser.isInvalid()) - { - Iterator sectionsIterator = this.listOfColumnSections.iterator(); - while(sectionsIterator.hasNext()) - { - FractionatorSectionTileEntity section = sectionsIterator.next(); - if(section==null || section.isInvalid()) - { - allright=false; - } - } - } - else - { - allright=false; - } - if(allright) - { - return true; - } - else - { - this.listOfColumnSections.clear(); - this.columnCover=null; - this.refluxCondenser=null; - boolean checking = true; - int height=0; - while(checking) - { - height++; - TileEntity te = worldObj.getTileEntity(xCoord, yCoord+height, zCoord); - if(te instanceof FractionatorSectionTileEntity) - { - FractionatorSectionTileEntity section = (FractionatorSectionTileEntity)te; - section.columnBottom=this; - this.listOfColumnSections.add(section); - } - else if(te instanceof FractionatorCoverTileEntity) - { - if(this.listOfColumnSections.isEmpty()) - { - return false; - } - FractionatorCoverTileEntity fcte = (FractionatorCoverTileEntity)te; - this.columnCover=fcte; - ForgeDirection orientation = ForgeDirection.getOrientation(fcte.getFacing()).getRotation(ForgeDirection.DOWN); - te = worldObj.getTileEntity(xCoord+orientation.offsetX, yCoord+height, zCoord+orientation.offsetZ); - if(te instanceof RefluxCondenserTileEntity) - { - if(((RefluxCondenserTileEntity)te).getFacing()==fcte.getFacing()) - { - this.refluxCondenser=(RefluxCondenserTileEntity)te; - this.refluxCondenser.columnBottom=this; - return true; - } - } - } - else - { - checking=false; - } - } - } - return false; - } - - @Override - public String getInventoryName() - { - return "fractionator"; - } - - public void onGuiClosed(EntityPlayer entityPlayer) {} - - public int fill(ForgeDirection direction, FluidStack fluidStack, boolean doFill) - { - if(direction.equals(ForgeDirection.UP)) - { - return waterTank.fill(fluidStack, doFill); - } - else - { - return fluidTank.fill(fluidStack, doFill); - } - } - - private int fillCondensateOutputApparatus(ForgeDirection direction,FluidStack fluidStack, boolean doFill) - { - TileEntity te = worldObj.getTileEntity(this.refluxCondenser.xCoord,this.refluxCondenser.yCoord-1,this.refluxCondenser.zCoord); - if(te instanceof IFluidHandler) - { - return ((IFluidHandler)te).fill(direction, fluidStack, doFill); - } - else - { - return 0; - } - } - - - private int fillVatResidueOutputApparatus(ForgeDirection orientation, FluidStack fluidStack, boolean doFill) { - TileEntity te = worldObj.getTileEntity(xCoord+orientation.offsetX,yCoord, zCoord+orientation.offsetZ); - if(te instanceof IFluidHandler) - { - return ((IFluidHandler)te).fill(orientation, fluidStack, doFill); - } - else - { - return 0; - } - } - - private int fillHeatTransferAgentOutputApparatus(ForgeDirection direction,FluidStack fluidStack, boolean doFill) - { - ForgeDirection orientation = ForgeDirection.getOrientation(this.refluxCondenser.getFacing()).getOpposite(); - TileEntity te = worldObj.getTileEntity(this.refluxCondenser.xCoord+orientation.offsetX,this.refluxCondenser.yCoord,this.refluxCondenser.zCoord+orientation.offsetZ); - if(te instanceof IFluidHandler) - { - return ((IFluidHandler)te).fill(orientation, fluidStack, doFill); - } - else - { - return 0; - } - } - - @Override - public void setFacing(short facing1) - { - super.setFacing((short) Math.max(facing1, 2)); - } - - public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { - return new FluidTankInfo[]{this.fluidTank.getInfo(), this.waterTank.getInfo()}; - } - - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - - @Override - public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - return this.fluidTank.drain(resource, doDrain); - } - - @Override - public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - return this.fluidTank.drain(maxDrain, doDrain); - } - - @Override - public boolean canFill(ForgeDirection from, Fluid fluid) { - return true; - } - - @Override - public boolean canDrain(ForgeDirection from, Fluid fluid) { - return true; - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/FractionatorCoverModel.java b/ihl/processing/chemistry/FractionatorCoverModel.java deleted file mode 100644 index 451d73c..0000000 --- a/ihl/processing/chemistry/FractionatorCoverModel.java +++ /dev/null @@ -1,52 +0,0 @@ -// Date: 05.04.2015 1:01:48 -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX -package ihl.processing.chemistry; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class FractionatorCoverModel extends ModelBase -{ - //fields - IHLModelRenderer Base; - - public FractionatorCoverModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.PipeUp03", 0, 0); - setTextureOffset("Base.ConeUp14to10", 0, 0); - setTextureOffset("Base.PipeUp", 0, 0); - setTextureOffset("Base.KneeUPWEST", 0, 0); - setTextureOffset("Base.WestPipe03", 0, 0); - setTextureOffset("Base.WestPipe04", 0, 0); - setTextureOffset("Base.ConeUp10To3", 0, 0); - setTextureOffset("Base.WestPipe02", 0, 0); - setTextureOffset("Base.WestPipe01", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addTube("PipeUp03", -8F, 7F, -8F, 16, 1, 16, .8F, 1F, ForgeDirection.UP); - Base.addTube("ConeUp14to10", -7F, 2F, -7F, 14, 5, 14, .8F, 0.71F, ForgeDirection.DOWN); - Base.addTube("PipeUp", -1.5F, -2.5F, -1.5F, 3, 3, 3, .8F, 1F, ForgeDirection.UP); - Base.addKnee("KneeUPWEST", -3F, -8.5F, -3F, 6, 6, 6, .8F, 1F, ForgeDirection.DOWN, ForgeDirection.WEST); - Base.addTube("WestPipe03", -7F, -7F, -1.5F, 4, 3, 3, .8F, 1F, ForgeDirection.WEST); - Base.addTube("WestPipe04", -8F, -7.5F, -2F, 1, 4, 4, .6F, 1F, ForgeDirection.WEST); - Base.addTube("ConeUp10To3", -5F, 0F, -5F, 10, 2, 10, .8F, 0.3F, ForgeDirection.DOWN); - Base.addTube("WestPipe02", -8F, 3F, -2F, 1, 4, 4, .6F, 1F, ForgeDirection.WEST); - Base.addTube("WestPipe01", -7F, 3.5F, -1.5F, 3, 3, 3, .8F, 1F, ForgeDirection.WEST); - } - - 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/chemistry/FractionatorCoverTileEntity.java b/ihl/processing/chemistry/FractionatorCoverTileEntity.java deleted file mode 100644 index 048f953..0000000 --- a/ihl/processing/chemistry/FractionatorCoverTileEntity.java +++ /dev/null @@ -1,104 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.ArrayList; -import java.util.List; - -import ic2.api.network.INetworkDataProvider; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ihl.utils.IHLUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class FractionatorCoverTileEntity extends TileEntity implements IWrenchable, INetworkDataProvider{ - - private short facing=2; - private short lastFacing=2; - public FractionatorBottomTileEntity columnBottom; - - public FractionatorCoverTileEntity() - { - super(); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public List getNetworkedFields() - { - List fields = new ArrayList(); - fields.add("facing"); - return fields; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if(lastFacing!=facing) - { - IC2.network.get().updateTileEntityField(this, "facing"); - lastFacing=facing; - } - } - - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=side; - } - - - @Override - public short getFacing() { - return this.facing; - } - - - @Override - public void setFacing(short facing1) - { - facing=(short) Math.max(2,facing1); - if(IC2.platform.isSimulating()) - { - IC2.network.get().updateTileEntityField(this, "facing"); - } - } - - - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } - - - @Override - public float getWrenchDropRate() { - return 1F; - } - - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("fractionatorCover"); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - facing=nbttagcompound.getShort("facing"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - nbttagcompound.setShort("facing", facing); - } -} diff --git a/ihl/processing/chemistry/FractionatorSectionModel.java b/ihl/processing/chemistry/FractionatorSectionModel.java deleted file mode 100644 index 2a20e7b..0000000 --- a/ihl/processing/chemistry/FractionatorSectionModel.java +++ /dev/null @@ -1,47 +0,0 @@ -// Date: 05.04.2015 16:59:49 -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX -package ihl.processing.chemistry; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - - -public class FractionatorSectionModel extends ModelBase -{ - //fields - IHLModelRenderer Base; - - public FractionatorSectionModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.PipeUp03", 0, 0); - setTextureOffset("Base.Pipeup02", 0, 0); - setTextureOffset("Base.WestPipe03", 0, 0); - setTextureOffset("Base.WestPipe04", 0, 0); - setTextureOffset("Base.PipeUp05", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addTube("PipeUp03", -8F, 7F, -8F, 16, 1, 16, 0.8F, 1.0F, ForgeDirection.UP); - Base.addTube("Pipeup02", -8F, -8F, -8F, 16, 1, 16, 0.8F, 1.0F, ForgeDirection.UP); - Base.addTube("WestPipe03", 4.5F, -1.5F, -1.5F, 3, 3, 3, 0.8F, 1.0F, ForgeDirection.WEST); - Base.addTube("WestPipe04", 7F, -2F, -2F, 1, 4, 4, 0.8F, 1.0F, ForgeDirection.WEST); - Base.addTube("PipeUp05", -7F, -7F, -7F, 14, 14, 14, 0.8F, 1.0F, ForgeDirection.UP); - } - - 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/chemistry/FractionatorSectionTileEntity.java b/ihl/processing/chemistry/FractionatorSectionTileEntity.java deleted file mode 100644 index e71c453..0000000 --- a/ihl/processing/chemistry/FractionatorSectionTileEntity.java +++ /dev/null @@ -1,148 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.ArrayList; -import java.util.List; - -import ic2.api.network.INetworkDataProvider; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ihl.utils.IHLUtils; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class FractionatorSectionTileEntity extends TileEntity implements IWrenchable, INetworkDataProvider, IFluidHandler{ - - private short facing=2; - private short lastFacing=2; - public FractionatorBottomTileEntity columnBottom; - - public FractionatorSectionTileEntity() - { - super(); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public List getNetworkedFields() - { - List fields = new ArrayList(); - fields.add("facing"); - return fields; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if(lastFacing!=facing) - { - IC2.network.get().updateTileEntityField(this, "facing"); - lastFacing=facing; - } - } - - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=side; - } - - - @Override - public short getFacing() { - return this.facing; - } - - - @Override - public void setFacing(short facing1) - { - facing=(short) Math.max(2,facing1); - if(IC2.platform.isSimulating()) - { - IC2.network.get().updateTileEntityField(this, "facing"); - } - } - - - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } - - - @Override - public float getWrenchDropRate() { - return 1F; - } - - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("fractionatorSection"); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - facing=nbttagcompound.getShort("facing"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - nbttagcompound.setShort("facing", facing); - } - - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return false; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP).equals(direction); - } - - @Override - public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return null; - } - - @Override - public FluidStack drain(ForgeDirection arg0, int arg1, boolean arg2) { - return null; - } - - @Override - public int fill(ForgeDirection direction, FluidStack fluidStack, boolean doFill) { - if(fluidStack!=null && fluidStack.getFluid()!=null && this.canFill(direction, fluidStack.getFluid()) && columnBottom!=null) - { - return columnBottom.fill(direction, fluidStack, doFill); - } - return 0; - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection arg0) - { - if(columnBottom!=null) - return columnBottom.getTankInfo(arg0); - else - return new FluidTankInfo[] {new FluidTankInfo(null, 8000)}; - } - -} diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java deleted file mode 100644 index b283a48..0000000 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java +++ /dev/null @@ -1,76 +0,0 @@ -package ihl.processing.chemistry; - -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 GaedesMercuryRotaryPumpContainer extends ContainerBase { - - protected GaedesMercuryRotaryPumpTileEntity tileEntity; - private final static int height=166; - public short lastEnergy = -1; - public short lastProgress = -1; - - public GaedesMercuryRotaryPumpContainer(EntityPlayer entityPlayer, GaedesMercuryRotaryPumpTileEntity tileEntity1){ - super(tileEntity1); - this.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.dischargeSlot, 0, 61, 36)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - if ((short) this.tileEntity.energy != this.lastEnergy) - { - icrafting.sendProgressBarUpdate(this, 2, (short) this.tileEntity.energy); - } - } - - this.lastProgress = this.tileEntity.progress; - this.lastEnergy = (short) this.tileEntity.energy; - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - case 2: - this.tileEntity.energy=value; - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java deleted file mode 100644 index 28c9edc..0000000 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java +++ /dev/null @@ -1,60 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -public class GaedesMercuryRotaryPumpGui extends GuiContainer { - - private GaedesMercuryRotaryPumpContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIGaedesMercuryRotaryPump.png"); - - public GaedesMercuryRotaryPumpGui(GaedesMercuryRotaryPumpContainer latheContainer) { - super(latheContainer); - container = latheContainer; - } - - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(tex); - int i1; - if (this.container.tileEntity.getEnergy() > 0D) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(51, 37 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); - this.drawTexturedModalRect(17, 30, getFrameX(i1), getFrameY(i1),24,24); - } - } - - @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); - } - - private int getFrameY(int number) - { - return (number % 10) * 24 + 14; - } - - private int getFrameX(int number) - { - return (number / 10) * 24 + 176; - } -} diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpModel.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpModel.java deleted file mode 100644 index 607d26a..0000000 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpModel.java +++ /dev/null @@ -1,64 +0,0 @@ -package ihl.processing.chemistry; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -// Date: 17.03.2015 21:30:34 -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -public class GaedesMercuryRotaryPumpModel extends ModelBase -{ - //fields - IHLModelRenderer Base; - - public GaedesMercuryRotaryPumpModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.PipeN1", 0, 0); - setTextureOffset("Base.PipeU3", 0, 0); - setTextureOffset("Base.Shape3", 0, 0); - setTextureOffset("Base.PipeN2", 0, 0); - setTextureOffset("Base.Shape5", 0, 0); - setTextureOffset("Base.Shape6", 0, 0); - setTextureOffset("Base.Shape7", 0, 0); - setTextureOffset("Base.PipeU4", 0, 0); - setTextureOffset("Base.Shape1", 0, 0); - setTextureOffset("Base.PipeW5", 0, 0); - setTextureOffset("Base.Shape2", 0, 0); - setTextureOffset("Base.Shape4", 0, 0); - setTextureOffset("Base.Shape8", 0, 0); - setTextureOffset("Base.PipeW8", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addTube("PipeN1", -5F, -5F, -6F, 10, 10, 10,0F,1F,ForgeDirection.NORTH); - Base.addTube("PipeU3", -0.5F, -2.5F, -8F, 1, 2, 1,0.1F,1F,ForgeDirection.UP); - Base.addBox("Shape3", -0.5F, -0.5F, -8F, 1, 1, 2); - Base.addTube("PipeN2", -3F, -2F, 4F, 6, 6, 4,0F,1F,ForgeDirection.NORTH); - Base.addBox("Shape5", -7F, 7F, -6F, 14, 1, 14); - Base.addBox("Shape6", 2F, 1F, -5F, 1, 6, 12); - Base.addBox("Shape7", -3F, 1F, -5F, 1, 6, 12); - Base.addTube("PipeU4", 0F, -8F, -5F, 1, 3, 1,0.1F,1F,ForgeDirection.UP); - Base.addBox("Shape1", 0F, -7F, -5F, 1, 1, 1); - Base.addTube("PipeW5", -1F, -7F, -5F, 8, 1, 1,0.1F,1F,ForgeDirection.WEST); - Base.addBox("Shape2", 4F, -8F, -5F, 1, 2, 1); - Base.addBox("Shape4", 4F, -8F, -1F, 1, 8, 1); - Base.addBox("Shape8", -5F, -8F, -1F, 1, 8, 1); - Base.addTube("PipeW8", -4F, -8F, -1F, 8, 1, 1,0.1F,1F,ForgeDirection.WEST); - } - - 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/chemistry/GaedesMercuryRotaryPumpTileEntity.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java deleted file mode 100644 index 186b606..0000000 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java +++ /dev/null @@ -1,83 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ihl.interfaces.IWorkspaceElement; -import ihl.processing.metallurgy.BasicElectricMotorTileEntity; -import ihl.utils.IHLUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -public class GaedesMercuryRotaryPumpTileEntity extends BasicElectricMotorTileEntity implements IWorkspaceElement{ - - public boolean ready=false; - - public GaedesMercuryRotaryPumpTileEntity() - { - } - - @Override - public void operate() - { - ready=true; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) - { - return IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump"); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public List[] getInput() - { - return null; - } - - @Override - public boolean canOperate() - { - return !ready; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new GaedesMercuryRotaryPumpGui(new GaedesMercuryRotaryPumpContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new GaedesMercuryRotaryPumpContainer(player, this); - } - - @Override - public boolean canBeUsed() - { - return ready; - } - - @Override - public void use() - { - ready=false; - } - - @Override - public boolean getIsInvalid() - { - return this.isInvalid(); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - -} diff --git a/ihl/processing/chemistry/LabElectrolyzerContainer.java b/ihl/processing/chemistry/LabElectrolyzerContainer.java deleted file mode 100644 index 1be5e01..0000000 --- a/ihl/processing/chemistry/LabElectrolyzerContainer.java +++ /dev/null @@ -1,73 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fluids.FluidStack; - -public class LabElectrolyzerContainer extends BasicElectricMotorContainer { - - protected LabElectrolyzerTileEntity tileEntity; - public short lastProgress = -1; - public short lastTemperature = -1; - public short lastEnergy = -1; - public int lastFluidAmount = -1; - public int lastNumberOfFluids = -1; - public int lastFluidAmount2 = -1; - public int lastNumberOfFluids2 = -1; - public int lastFluidAmount3 = -1; - public int lastNumberOfFluids3 = -1; - public List fluidTankFluidList; - public List fluidTankFluidList2; - public List fluidTankFluidList3; - - public LabElectrolyzerContainer(EntityPlayer entityPlayer, LabElectrolyzerTileEntity tileEntity1) { - super(entityPlayer, tileEntity1); - this.tileEntity = tileEntity1; - fluidTankFluidList = this.tileEntity.getFluidTank().getFluidList(); - fluidTankFluidList2 = this.tileEntity.fluidTankAnodeOutput.getFluidList(); - fluidTankFluidList3 = this.tileEntity.fluidTankCathodeOutput.getFluidList(); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 63, 47)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlotAnodeOutput, 0, 109, 47)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlotCathodeOutput, 0, 29, 47)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 63, 11)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 29, 11)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 1, 63, 29)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 2, 109, 11)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 63, 65)); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (this.tileEntity.getTankAmount() != this.lastFluidAmount - || this.tileEntity.getNumberOfFluidsInTank() != this.lastNumberOfFluids) { - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - - if (this.tileEntity.fluidTankAnodeOutput.getFluidAmount() != this.lastFluidAmount2 - || this.tileEntity.fluidTankAnodeOutput.getNumberOfFluids() != this.lastNumberOfFluids2) { - IC2.network.get().sendContainerField(this, "fluidTankFluidList2"); - } - - if (this.tileEntity.fluidTankCathodeOutput.getFluidAmount() != this.lastFluidAmount3 - || this.tileEntity.fluidTankCathodeOutput.getNumberOfFluids() != this.lastNumberOfFluids3) { - IC2.network.get().sendContainerField(this, "fluidTankFluidList3"); - } - - this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); - this.lastFluidAmount = this.tileEntity.getTankAmount(); - this.lastNumberOfFluids2 = this.tileEntity.fluidTankAnodeOutput.getNumberOfFluids(); - this.lastFluidAmount2 = this.tileEntity.fluidTankAnodeOutput.getFluidAmount(); - this.lastNumberOfFluids3 = this.tileEntity.fluidTankCathodeOutput.getNumberOfFluids(); - this.lastFluidAmount3 = this.tileEntity.fluidTankCathodeOutput.getFluidAmount(); - - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/LabElectrolyzerGui.java b/ihl/processing/chemistry/LabElectrolyzerGui.java deleted file mode 100644 index 3eb14a3..0000000 --- a/ihl/processing/chemistry/LabElectrolyzerGui.java +++ /dev/null @@ -1,74 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -@SideOnly(Side.CLIENT) -public class LabElectrolyzerGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", - "textures/gui/GUILabElectrolyzer.png"); - private LabElectrolyzerContainer container; - - public LabElectrolyzerGui(LabElectrolyzerContainer container1) { - // the container is instanciated and passed to the superclass for - // handling - super(container1); - this.container = container1; - } - - @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) { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12), 12); - this.drawTexturedModalRect(12, 16 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27), 27); - this.drawTexturedModalRect(81, 31, getFrameX(i1), getFrameY(i1), 24, 24); - } - if (this.container.tileEntity.getTankAmount() > 0) { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 83, 15, 104, 81, zLevel, - par1, par2, xOffset, yOffset); - } - if (this.container.tileEntity.fluidTankCathodeOutput.getFluidAmount() > 0) { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankCathodeOutput, 48, 24, 59, 81, - zLevel, par1, par2, xOffset, yOffset); - } - if (this.container.tileEntity.fluidTankAnodeOutput.getFluidAmount() > 0) { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankAnodeOutput, 128, 24, 139, 81, - zLevel, par1, par2, xOffset, yOffset); - } - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - private int getFrameY(int number) { - return (number % 10) * 24 + 14; - } - - private int getFrameX(int number) { - return (number / 10) * 24 + 176; - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/LabElectrolyzerTileEntity.java b/ihl/processing/chemistry/LabElectrolyzerTileEntity.java deleted file mode 100644 index 19348b6..0000000 --- a/ihl/processing/chemistry/LabElectrolyzerTileEntity.java +++ /dev/null @@ -1,272 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.block.invslot.InvSlot; -import ic2.core.block.invslot.InvSlotConsumableLiquid; -import ic2.core.block.invslot.InvSlotOutput; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.processing.metallurgy.BasicElectricMotorTileEntity; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler { - private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("labelectrolyzer"); - public final IHLInvSlotOutput outputSlot; - public final InvSlotConsumableLiquidIHL drainInputSlot; - public final InvSlotConsumableLiquidIHL fillInputSlot; - public final InvSlotConsumableLiquidIHL fillInputSlotAnodeOutput; - public final InvSlotConsumableLiquidIHL fillInputSlotCathodeOutput; - public final InvSlotOutput emptyFluidItemsSlot; - private final IHLFluidTank fluidTank = new IHLFluidTank(2000); - public final IHLFluidTank fluidTankAnodeOutput = new IHLFluidTank(8000); - public final IHLFluidTank fluidTankCathodeOutput = new IHLFluidTank(8000); - public short temperature = 20; - - public LabElectrolyzerTileEntity() { - super(); - this.energyConsume *= 10; - this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 2); - 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.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); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) { - super.readFromNBT(nbttagcompound); - this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); - this.fluidTankAnodeOutput.readFromNBT(nbttagcompound.getCompoundTag("fluidTankAnodeOutput")); - this.fluidTankCathodeOutput.readFromNBT(nbttagcompound.getCompoundTag("fluidTankCathodeOutput")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankTag = new NBTTagCompound(); - this.fluidTank.writeToNBT(fluidTankTag); - nbttagcompound.setTag("fluidTank", fluidTankTag); - - NBTTagCompound fluidTankAnodeTag = new NBTTagCompound(); - this.fluidTankAnodeOutput.writeToNBT(fluidTankAnodeTag); - nbttagcompound.setTag("fluidTankAnodeOutput", fluidTankAnodeTag); - - NBTTagCompound fluidTankCathodeTag = new NBTTagCompound(); - this.fluidTankCathodeOutput.writeToNBT(fluidTankCathodeTag); - nbttagcompound.setTag("fluidTankCathodeOutput", fluidTankCathodeTag); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing() != side; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("labElectrolyzer"); - } - - @Override - public boolean enableUpdateEntity() { - return IC2.platform.isSimulating(); - } - - @Override - public void updateEntityServer() { - super.updateEntityServer(); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlotAnodeOutput, null, emptyFluidItemsSlot, fluidTankAnodeOutput); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlotCathodeOutput, null, emptyFluidItemsSlot, - fluidTankCathodeOutput); - } - - @Override - public FluidStack drain(ForgeDirection direction, int amount, boolean doDrain) { - if (this.canDrain(direction, null)) { - if (direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP))) { - return this.fluidTankAnodeOutput.drain(amount, doDrain); - } - if (direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.DOWN))) { - return this.fluidTankCathodeOutput.drain(amount, doDrain); - } - return this.fluidTank.drain(amount, doDrain); - } - return null; - } - - // 1.7.10 API - @Override - public boolean canDrain(ForgeDirection direction, Fluid arg1) { - return direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP)) - || direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.DOWN)) - || direction.equals(ForgeDirection.DOWN); - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return direction.equals(ForgeDirection.getOrientation(this.getFacing()).getOpposite()); - } - - @Override - public String getInventoryName() { - return "labElectrolizer"; - } - - @Override - public int gaugeProgressScaled(int i) { - return this.progress * i / operationLength; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new LabElectrolyzerGui(new LabElectrolyzerContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - this.fluidTank.sortFluidsByDensity(); - return new LabElectrolyzerContainer(player, this); - } - - @Override - public void onGuiClosed(EntityPlayer player) { - } - - @Override - public boolean canOperate() { - UniversalRecipeOutput output = getOutput(); - if (output != null) { - if (getOutput().getItemOutputs() != null && !getOutput().getItemOutputs().isEmpty() - && getOutput().getItemOutputs().get(0) != null) { - return this.outputSlot.canAdd(getOutput().getItemOutputs()); - } else { - return this.fluidTankAnodeOutput.getFluidAmount() < this.fluidTankAnodeOutput.getCapacity() - && this.fluidTankAnodeOutput.getFluidAmount() < this.fluidTankCathodeOutput.getCapacity(); - } - } - return false; - } - - public UniversalRecipeOutput getOutput() { - return LabElectrolyzerTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public List[] getInput() { - return new List[] { Arrays.asList(new FluidStack[] { fluidTank.getFluid() }), null }; - } - - @Override - public void operate() { - UniversalRecipeInput recipeInput = LabElectrolyzerTileEntity.recipeManager.getRecipeInput(getInput()); - UniversalRecipeOutput output1 = getOutput(); - this.fluidTank.drain(recipeInput.getFluidInputs().get(0), true); - if (output1.getFluidOutputs().size() > 0) - this.fluidTankAnodeOutput.fill(output1.getFluidOutputs().get(0).copy(), true); - if (output1.getFluidOutputs().size() > 1) - this.fluidTankCathodeOutput.fill(output1.getFluidOutputs().get(1).copy(), true); - if (!output1.getItemOutputs().isEmpty() && output1.getItemOutputs().get(0) != null) - this.outputSlot.add(output1.getItemOutputs()); - } - - @Override - public FluidStack drain(ForgeDirection direction, FluidStack fluidStack, boolean doDrain) { - if (this.fluidTankAnodeOutput.getFluid().containsFluid(fluidStack)) { - return this.fluidTankAnodeOutput.drain(fluidStack.amount, doDrain); - } else if (this.fluidTankCathodeOutput.getFluid().containsFluid(fluidStack)) { - return this.fluidTankCathodeOutput.drain(fluidStack.amount, doDrain); - } - return null; - } - - @Override - public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return this.fluidTank.fill(arg1, arg2); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection direction) { - if (direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP))) { - return new FluidTankInfo[] { this.fluidTankAnodeOutput.getInfo() }; - } - if (direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.DOWN))) { - return new FluidTankInfo[] { this.fluidTankCathodeOutput.getInfo() }; - } - return new FluidTankInfo[] { this.fluidTank.getInfo() }; - - } - - public boolean needsFluid() { - return this.fluidTank.getFluidAmount() <= this.fluidTank.getCapacity(); - } - - public FluidStack getFluidStackfromTank() { - return this.fluidTank.getFluid(); - } - - public int getTankAmount() { - return this.fluidTank.getFluidAmount(); - } - - public int gaugeLiquidScaled(int i, int index) { - return this.fluidTank.getFluidAmount() <= 0 ? 0 - : this.fluidTank.getFluidAmount(index) * i / this.fluidTank.getCapacity(); - } - - public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) { - recipeManager.addRecipe(input, output); - } - - public int getNumberOfFluidsInTank() { - return this.fluidTank.getNumberOfFluids(); - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - public static void addRecipe(FluidStack fluidStackInput1, FluidStack fluidStackOutputAnode, - FluidStack fluidStackOutputCathode, ItemStack itemStackOutput1) { - if (itemStackOutput1 != null) { - addRecipe(new UniversalRecipeInput((new FluidStack[] { fluidStackInput1 }), null), - new UniversalRecipeOutput((new FluidStack[] { fluidStackOutputAnode, fluidStackOutputCathode }), - (new ItemStack[] { itemStackOutput1 }), 200)); - } else { - addRecipe(new UniversalRecipeInput((new FluidStack[] { fluidStackInput1 }), null), - new UniversalRecipeOutput((new FluidStack[] { fluidStackOutputAnode, fluidStackOutputCathode }), - null, 200)); - } - } - - public IHLFluidTank getFluidTank() { - return this.fluidTank; - } - -} \ No newline at end of file diff --git a/ihl/processing/chemistry/LeadOvenContainer.java b/ihl/processing/chemistry/LeadOvenContainer.java deleted file mode 100644 index 2f0ff8a..0000000 --- a/ihl/processing/chemistry/LeadOvenContainer.java +++ /dev/null @@ -1,95 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraftforge.fluids.FluidStack; - -public class LeadOvenContainer extends ContainerBase { - - protected LeadOvenTileEntity tileEntity; - public int lastInputFluidAmount = -1; - public int lastOutputFluidAmount = -1; - public int lastFuel = -1; - public short lastProgress = -1; - private final static int height = 166; - public List inputTankFluidList; - public List outputTankFluidList; - - public LeadOvenContainer(EntityPlayer entityPlayer, LeadOvenTileEntity tileEntity1) { - super(tileEntity1); - this.tileEntity = tileEntity1; - inputTankFluidList = this.tileEntity.inputTank.getFluidList(); - outputTankFluidList = this.tileEntity.outputTank.getFluidList(); - 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.fuelSlot, 0, 56, 53)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.inputSlot, 0, 47, 17)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.inputSlot, 1, 65, 17)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 112, 35)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 9, 53)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 9, 17)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 9, 35)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot2, 0, 150, 53)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot2, 0, 150, 17)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 1, 150, 35)); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.tileEntity.inputTank.getFluidAmount() != this.lastInputFluidAmount) { - IC2.network.get().sendContainerField(this, "inputTankFluidList"); - } - if (this.tileEntity.outputTank.getFluidAmount() != this.lastOutputFluidAmount) { - IC2.network.get().sendContainerField(this, "outputTankFluidList"); - } - - if (this.tileEntity.fuel != this.lastFuel) { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.fuel); - } - - if (this.tileEntity.progress != this.lastProgress) { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.progress); - } - } - this.lastFuel = this.tileEntity.fuel; - this.lastProgress = this.tileEntity.progress; - this.lastInputFluidAmount = this.tileEntity.inputTank.getFluidAmount(); - this.lastOutputFluidAmount = this.tileEntity.outputTank.getFluidAmount(); - } - - @Override - public void updateProgressBar(int index, int value) { - super.updateProgressBar(index, value); - - switch (index) { - case 0: - this.tileEntity.fuel = value; - break; - case 1: - this.tileEntity.progress = (short) value; - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/LeadOvenGui.java b/ihl/processing/chemistry/LeadOvenGui.java deleted file mode 100644 index 72fb107..0000000 --- a/ihl/processing/chemistry/LeadOvenGui.java +++ /dev/null @@ -1,55 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -@SideOnly(Side.CLIENT) -public class LeadOvenGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUILeadOven.png"); - private LeadOvenContainer container; - - public LeadOvenGui(LeadOvenContainer container1) { - // the container is instanciated and passed to the superclass for - // handling - super(container1); - this.container = container1; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - if (this.container.tileEntity.inputTank.getFluidAmount() > 0) { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.inputTank, 30, 19, 42, 66, zLevel, - par1, par2, x, y); - } - if (this.container.tileEntity.outputTank.getFluidAmount() > 0) { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.outputTank, 133, 19, 145, 66, zLevel, - par1, par2, x, y); - } - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - int i1; - if (this.container.tileEntity.fuel > 0) { - i1 = this.container.tileEntity.gaugeFuelScaled(12); - this.drawTexturedModalRect(x + 56, y + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2); - } - i1 = this.container.tileEntity.gaugeProgressScaled(24); - this.drawTexturedModalRect(x + 79, y + 34, 176, 14, i1 + 1, 16); - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/LeadOvenTileEntity.java b/ihl/processing/chemistry/LeadOvenTileEntity.java deleted file mode 100644 index 95636ad..0000000 --- a/ihl/processing/chemistry/LeadOvenTileEntity.java +++ /dev/null @@ -1,286 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -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; -import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.block.invslot.InvSlotConsumableFuel; -import ic2.core.block.invslot.InvSlotConsumableLiquid; -import ic2.core.block.invslot.InvSlotOutput; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.recipes.RecipeOutputItemStack; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class LeadOvenTileEntity extends TileEntityInventory implements IHasGui, IFluidHandler { - public final InvSlotConsumableFuel fuelSlot; - public final ApparatusProcessableInvSlot inputSlot; - public final IHLInvSlotOutput outputSlot; - public final IHLFluidTank inputTank = new IHLFluidTank(1000); - public final IHLFluidTank outputTank = new IHLFluidTank(1000); - public final InvSlotConsumableLiquidIHL drainInputSlot; - public final InvSlotConsumableLiquidIHL fillInputSlot; - public final InvSlotOutput emptyFluidItemsSlot; - public final InvSlotConsumableLiquidIHL drainInputSlot2; - public final InvSlotConsumableLiquidIHL fillInputSlot2; - public short progress = 0; - public final short maxProgress = 160; - public int fuel = 0; - public int maxFuel = 0; - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("chemicaloven"); - - public LeadOvenTileEntity() { - super(); - this.fuelSlot = new InvSlotConsumableFuel(this, "fuel", 1, 1, true); - this.inputSlot = new ApparatusProcessableInvSlot(this, "input", 2, Access.IO, 2, 64); - this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); - 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.drainInputSlot2 = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, - InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Drain); - this.fillInputSlot2 = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, - InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); - this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 2); - } - - public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) { - recipeManager.addRecipe(input, output); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) { - super.readFromNBT(nbttagcompound); - this.fuel = nbttagcompound.getInteger("fuel"); - this.maxFuel = nbttagcompound.getInteger("maxFuel"); - this.progress = nbttagcompound.getShort("progress"); - this.inputTank.readFromNBT(nbttagcompound.getCompoundTag("inputTank")); - this.outputTank.readFromNBT(nbttagcompound.getCompoundTag("outputTank")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) { - super.writeToNBT(nbttagcompound); - nbttagcompound.setInteger("fuel", this.fuel); - nbttagcompound.setInteger("maxFuel", this.maxFuel); - nbttagcompound.setShort("progress", this.progress); - NBTTagCompound inputTankTag = new NBTTagCompound(); - this.inputTank.writeToNBT(inputTankTag); - nbttagcompound.setTag("inputTank", inputTankTag); - NBTTagCompound outputTankTag = new NBTTagCompound(); - this.outputTank.writeToNBT(outputTankTag); - nbttagcompound.setTag("outputTank", outputTankTag); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing() != (short) side && side != 0 && side != 1; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("leadOven"); - } - - public int gaugeProgressScaled(int i) { - return this.progress * i / maxProgress; - } - - public int gaugeFuelScaled(int i) { - if (this.maxFuel == 0) { - this.maxFuel = this.fuel; - - if (this.maxFuel == 0) { - this.maxFuel = 160; - } - } - - return this.fuel * i / this.maxFuel; - } - - public boolean enableUpdateEntity() { - return IC2.platform.isSimulating(); - } - - @Override - public void updateEntityServer() { - super.updateEntityServer(); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, inputTank); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot2, drainInputSlot2, emptyFluidItemsSlot, outputTank); - if (this.fuel <= 0 && this.canOperate()) { - this.fuel = this.maxFuel = this.fuelSlot.consumeFuel(); - } - - if (this.isBurning() && this.canOperate()) { - ++this.progress; - - if (this.progress >= maxProgress) { - this.progress = 0; - this.operate(); - } - } else { - this.progress = 0; - } - - if (this.fuel > 0) { - --this.fuel; - } - - if (this.getActive() != this.isBurning()) { - this.setActive(this.isBurning()); - } - } - - public boolean isBurning() { - return this.fuel > 0; - } - - public boolean canOperate() { - return this.getOutput() != null; - } - - /** - * Returns the name of the inventory - */ - @Override - public String getInventoryName() { - return "goldOven"; - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { - return new LeadOvenContainer(entityPlayer, this); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) { - return new LeadOvenGui(new LeadOvenContainer(entityPlayer, this)); - } - - @Override - public void onGuiClosed(EntityPlayer entityPlayer) { - } - - public UniversalRecipeOutput getOutput() { - return LeadOvenTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @SuppressWarnings("rawtypes") - public List[] getInput() { - if (this.inputSlot.get(1) != null) { - return new List[] { this.inputTank.getFluidList(), - Arrays.asList(new ItemStack[] { this.inputSlot.get(0), this.inputSlot.get(1) }) }; - } - return new List[] { this.inputTank.getFluidList(), Arrays.asList(new ItemStack[] { this.inputSlot.get() }) }; - } - - public void operate() { - UniversalRecipeInput rinput = LeadOvenTileEntity.recipeManager.getRecipeInput(getInput()); - List rinputItems = rinput.getItemInputs(); - UniversalRecipeOutput routput = LeadOvenTileEntity.recipeManager.getOutputFor(getInput()); - List output2 = routput.getFluidOutputs(); - if (!output2.isEmpty()) { - this.outputTank.fill(output2.get(0), true); - } - this.inputTank.drain(rinput.getFluidInputs(), true); - List itemOutputs = routput.getItemOutputs(); - if (itemOutputs != null && !itemOutputs.isEmpty()) { - this.outputSlot.add(itemOutputs); - } - for (int i = 0; i < rinputItems.size(); i++) { - this.inputSlot.consume(rinputItems.get(i)); - } - - } - - @Override - public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) { - switch (from) { - case UP: - return this.outputTank.drainLightest(amount, doDrain); - case NORTH: - return this.outputTank.drainLightest(amount, doDrain); - case SOUTH: - return this.outputTank.drainLightest(amount, doDrain); - case WEST: - return this.outputTank.drainLightest(amount, doDrain); - case EAST: - return this.outputTank.drainLightest(amount, doDrain); - case DOWN: - return this.outputTank.drain(amount, doDrain); - default: - return this.outputTank.drain(amount, doDrain); - } - } - - // 1.7.10 API - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return true; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return direction.equals(ForgeDirection.getOrientation(this.getFacing()).getOpposite()); - } - - public static void addRecipe(UniversalRecipeInput input, FluidStack fluidStackWithSize) { - recipeManager.addRecipe(input, new UniversalRecipeOutput((new FluidStack[] { fluidStackWithSize }), null, 20)); - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - public static void addRecipe(IRecipeInput recipeInputOreDict, FluidStack fluidStackOutput, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { recipeInputOreDict })), - new UniversalRecipeOutput((new FluidStack[] { fluidStackOutput }), (new ItemStack[] { output }), 20)); - } - - public static void addRecipe(IRecipeInput input, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { input })), - new UniversalRecipeOutput(null, (new ItemStack[] { output }), 20)); - } - - @Override - public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { - if (outputTank.getFluid() != null && outputTank.getFluid().containsFluid(fluidStack)) { - return this.outputTank.drain(fluidStack, doDrain); - } - return null; - } - - @Override - public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return this.inputTank.fill(arg1, arg2); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { - return new FluidTankInfo[] { this.inputTank.getInfo() }; - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/LoomContainer.java b/ihl/processing/chemistry/LoomContainer.java deleted file mode 100644 index 2d480ef..0000000 --- a/ihl/processing/chemistry/LoomContainer.java +++ /dev/null @@ -1,66 +0,0 @@ -package ihl.processing.chemistry; - -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 LoomContainer extends ContainerBase { - - public LoomTileEntity tileEntity; - public int lastProgress = -1; - private final static int height=166; - - public LoomContainer(EntityPlayer entityPlayer, - LoomTileEntity lathePart1TileEntity) { - super(lathePart1TileEntity); - tileEntity=lathePart1TileEntity; - 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(lathePart1TileEntity.input, 0, 8, 44)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 127, 44)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - } - this.lastProgress = this.tileEntity.progress; - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - - } - } - -} diff --git a/ihl/processing/chemistry/LoomGui.java b/ihl/processing/chemistry/LoomGui.java deleted file mode 100644 index 4964687..0000000 --- a/ihl/processing/chemistry/LoomGui.java +++ /dev/null @@ -1,60 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import ic2.core.IC2; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -public class LoomGui extends GuiContainer { - - private LoomContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUILoom.png"); - - public LoomGui(LoomContainer 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); - } - IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.coiler.tip")); - } - - @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/chemistry/LoomModel.java b/ihl/processing/chemistry/LoomModel.java deleted file mode 100644 index 31c2724..0000000 --- a/ihl/processing/chemistry/LoomModel.java +++ /dev/null @@ -1,66 +0,0 @@ -package ihl.processing.chemistry; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class LoomModel extends ModelBase -{ - //fields - IHLModelRenderer RotatePart; - IHLModelRenderer Piece1; - - public LoomModel() - { - 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/chemistry/LoomTileEntity.java b/ihl/processing/chemistry/LoomTileEntity.java deleted file mode 100644 index 8432a2d..0000000 --- a/ihl/processing/chemistry/LoomTileEntity.java +++ /dev/null @@ -1,172 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -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 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; - -public class LoomTileEntity extends TileEntityInventory implements IHasGui, INetworkClientTileEntityEventListener -{ - protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("loom"); - public short progress; - protected short operationLength=200; - public final ApparatusProcessableInvSlot input; - public final IHLInvSlotOutput output; - boolean isGuiScreenOpened=false; - - public LoomTileEntity() - { - 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 "Loom"; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("loom"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new LoomGui(new LoomContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - this.isGuiScreenOpened=true; - return new LoomContainer(player, this); - } - - public void operate() - { - List input1 = LoomTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); - List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput()).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(input1.get(0)); - } - } - - @SuppressWarnings("rawtypes") - public List[] getInput() - { - return new List[] {null,Arrays.asList(new ItemStack[] {input.get()})}; - } - - public boolean canOperate() - { - if(LoomTileEntity.recipeManager.getOutputFor(getInput())==null) return false; - List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput()).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,new ItemStack[] {input}), new UniversalRecipeOutput(null, 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/chemistry/PaperMachineContainer.java b/ihl/processing/chemistry/PaperMachineContainer.java deleted file mode 100644 index 01db6fd..0000000 --- a/ihl/processing/chemistry/PaperMachineContainer.java +++ /dev/null @@ -1,41 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fluids.FluidStack; - -public class PaperMachineContainer extends BasicElectricMotorContainer { - - protected PaperMachineTileEntity tileEntity; - public int lastFluidAmount = -1; - public int lastNumberOfFluids = -1; - public short lastProgress = -1; - public short lastTemperature = -1; - public short lastEnergy = -1; - public List fluidTankFluidList; - - public PaperMachineContainer(EntityPlayer entityPlayer, PaperMachineTileEntity tileEntity1){ - super(entityPlayer, tileEntity1); - this.tileEntity = tileEntity1; - fluidTankFluidList=this.tileEntity.getFluidTank().getFluidList(); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 78, 51)); - 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)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - if (this.tileEntity.getTankAmount() != this.lastFluidAmount || this.tileEntity.getNumberOfFluidsInTank() != this.lastNumberOfFluids) - { - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); - this.lastFluidAmount = this.tileEntity.getTankAmount(); - } -} diff --git a/ihl/processing/chemistry/PaperMachineGui.java b/ihl/processing/chemistry/PaperMachineGui.java deleted file mode 100644 index 8fea247..0000000 --- a/ihl/processing/chemistry/PaperMachineGui.java +++ /dev/null @@ -1,79 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -@SideOnly(Side.CLIENT) -public class PaperMachineGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIPaperMachine.png"); - private PaperMachineContainer container; - private int mixerFrame=0; - - public PaperMachineGui (PaperMachineContainer container1) { - //the container is instanciated and passed to the superclass for handling - super(container1); - this.container=container1; - } - - @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) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(12, 16 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); - this.drawTexturedModalRect(38, 29, getFrameX(i1), getFrameY(i1),24,24); - if(mixerFrame++>4) - { - mixerFrame=0; - } - } - else - { - mixerFrame=0; - } - this.drawTexturedModalRect(103, 52, 246, 226+6*mixerFrame,10,6); - if (this.container.tileEntity.getTankAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102, 28, 114, 59, zLevel, par1, par2, xOffset, yOffset); - } - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - private int getFrameY(int number) - { - return (number % 10) * 24 + 14; - } - - private int getFrameX(int number) - { - return (number / 10) * 24 + 176; - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/PaperMachineTileEntity.java b/ihl/processing/chemistry/PaperMachineTileEntity.java deleted file mode 100644 index dddd306..0000000 --- a/ihl/processing/chemistry/PaperMachineTileEntity.java +++ /dev/null @@ -1,261 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.block.invslot.InvSlot; -import ic2.core.block.invslot.InvSlotConsumableLiquid; -import ic2.core.block.invslot.InvSlotOutput; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.processing.metallurgy.BasicElectricMotorTileEntity; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class PaperMachineTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler -{ - private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("papermachine"); - public final IHLInvSlotOutput outputSlot; - public final InvSlotConsumableLiquidIHL drainInputSlot; - public final InvSlotConsumableLiquidIHL fillInputSlot; - public final InvSlotOutput emptyFluidItemsSlot; - private final IHLFluidTank fluidTank = new IHLFluidTank(8000); - public short temperature=20; - - public PaperMachineTileEntity() { - super(); - this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 2); - 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); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankTag = new NBTTagCompound(); - this.fluidTank.writeToNBT(fluidTankTag); - nbttagcompound.setTag("fluidTank", fluidTankTag); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=side; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("paperMachine"); - } - - @Override - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - } - - @Override - public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) - { - FluidStack fstack = this.fluidTank.drain(amount, doDrain); - return fstack; - } - - - //1.7.10 API - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return true; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return direction.equals(ForgeDirection.UP); - } - - @Override - public String getInventoryName() { - return "chemicalReactor"; - } - - public float getRenderLiquidLevel() - { - return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity(); - } - - @Override - public int gaugeProgressScaled(int i) - { - return this.progress * i / operationLength; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new PaperMachineGui(new PaperMachineContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) - { - this.fluidTank.sortFluidsByDensity(); - return new PaperMachineContainer(player, this); - } - - @Override - public void onGuiClosed(EntityPlayer player) {} - - @Override - public boolean canOperate() - { - UniversalRecipeOutput output = getOutput(); - if(output!=null && this.outputSlot.canAdd(getOutput().getItemOutputs())) - { - if(output.specialConditions) - { - return this.checkSpecialConditions(); - } - else - { - return true; - } - } - 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 PaperMachineTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @Override - @SuppressWarnings({ "rawtypes", "unchecked" }) - public List[] getInput() - { - return new List[] {Arrays.asList(new FluidStack[]{fluidTank.getFluid()}), null}; - } - - @Override - public void operate() - { - UniversalRecipeInput recipeInput = PaperMachineTileEntity.recipeManager.getRecipeInput(getInput()); - UniversalRecipeOutput output1 = getOutput(); - this.fluidTank.drain(recipeInput.getFluidInputs(), true); - this.fluidTank.fill(output1.getFluidOutputs(), true); - if(!output1.getItemOutputs().isEmpty() && output1.getItemOutputs().get(0)!=null)this.outputSlot.add(output1.getItemOutputs()); - } - - @Override - public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { - if(fluidTank.getFluid()!=null && fluidTank.getFluid().containsFluid(fluidStack)) - { - return this.fluidTank.drain(fluidStack, doDrain); - } - return null; - } - - @Override - public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return this.fluidTank.fill(arg1, arg2); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { - return new FluidTankInfo[] {this.fluidTank.getInfo()}; - } - - public boolean needsFluid() - { - return this.fluidTank.getFluidAmount() <= this.fluidTank.getCapacity(); - } - - public FluidStack getFluidStackfromTank() - { - return this.fluidTank.getFluid(); - } - - public int getTankAmount() - { - return this.fluidTank.getFluidAmount(); - } - - public int gaugeLiquidScaled(int i, int index) - { - return this.fluidTank.getFluidAmount() <= 0 ? 0 : this.fluidTank.getFluidAmount(index) * i / this.fluidTank.getCapacity(); - } - public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) - { - recipeManager.addRecipe(input, output); - } - - public int getNumberOfFluidsInTank() - { - return this.fluidTank.getNumberOfFluids(); - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackOutput1) - { - 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(new FluidStack[] {fluidStackInput1, fluidStackInput2}, (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); - } - - public IHLFluidTank getFluidTank() - { - return this.fluidTank; - } - -} \ No newline at end of file diff --git a/ihl/processing/chemistry/RefluxCondenserModel.java b/ihl/processing/chemistry/RefluxCondenserModel.java deleted file mode 100644 index 9cb2f2f..0000000 --- a/ihl/processing/chemistry/RefluxCondenserModel.java +++ /dev/null @@ -1,70 +0,0 @@ -// Date: 05.04.2015 16:30:47 -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX -package ihl.processing.chemistry; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - - -public class RefluxCondenserModel extends ModelBase -{ - //fields - IHLModelRenderer Base; - IHLModelRenderer RotatingPartZ; - - public RefluxCondenserModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.PipeUp03", 0, 0); - setTextureOffset("Base.KneeUpEast", 0, 0); - setTextureOffset("Base.WestPipe03", 0, 0); - setTextureOffset("Base.WestPipe04", 0, 0); - setTextureOffset("Base.WestPipe02", 0, 0); - setTextureOffset("Base.WestPipe01", 0, 0); - setTextureOffset("Base.Shape1", 0, 0); - setTextureOffset("Base.PipeUp06", 0, 0); - setTextureOffset("Base.PipeUp07", 0, 0); - setTextureOffset("Base.PipeNorth07", 0, 0); - setTextureOffset("Base.PipeNorth08", 0, 0); - setTextureOffset("RotatingPartZ.ConeWest05", 0, 0); - setTextureOffset("RotatingPartZ.PipeWest07", 0, 0); - setTextureOffset("RotatingPartZ.ConeEast06", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addTube("PipeUp03", -2F, 7F, -2F, 4, 1, 4, 0.6f, 1f,ForgeDirection.UP); - Base.addKnee("KneeUpEast", -8F, 2F, -3F, 5, 6, 6, .8F, 1F, ForgeDirection.UP, ForgeDirection.EAST); - Base.addTube("WestPipe03", 3.5F, -7F, -1.5F, 4, 3, 3, 0.8f, 1f,ForgeDirection.WEST); - Base.addTube("WestPipe04", 7F, -7.5F, -2F, 1, 4, 4, 0.6f, 1f,ForgeDirection.WEST); - Base.addTube("WestPipe02", 7F, 3F, -2F, 1, 4, 4, 0.6f, 1f,ForgeDirection.WEST); - Base.addTube("WestPipe01", -3F, 3.5F, -1.5F, 10, 3, 3, .8F, 1F, ForgeDirection.WEST); - Base.addTube("Shape1", -2F, -8F, -2F, 4, 1, 4, 0.6f, 1f,ForgeDirection.UP); - Base.addTube("PipeUp06", -1.5F, -7F, -1.5F, 3, 2, 3, 0.8f, 1f,ForgeDirection.UP); - Base.addTube("PipeUp07", -1.5F, 5F, -1.5F, 3, 2, 3, 0.8f, 1f,ForgeDirection.UP); - Base.addTube("PipeNorth07", -2F, -2F, -8F, 4, 4, 1, 0.6f, 1f,ForgeDirection.NORTH); - Base.addTube("PipeNorth08", -1.5F, -1.5F, -7F, 3, 3, 7, 0.8f, 1f,ForgeDirection.NORTH); - RotatingPartZ = new IHLModelRenderer(this, "RotatingPartZ"); - RotatingPartZ.setRotationPoint(3F, 13F, 0F); - setRotation(RotatingPartZ, 0F, 0F, -0.5F); - RotatingPartZ.mirror = true; - RotatingPartZ.addTube("ConeWest05", 1F, -4F, -4F, 2, 8, 8, 0f, 0.8f,ForgeDirection.WEST); - RotatingPartZ.addTube("PipeWest07", -9F, -4F, -4F, 10, 8, 8, 0.8f, 1f,ForgeDirection.WEST); - RotatingPartZ.addTube("ConeEast06", -11F, -4F, -4F, 2, 8, 8, 0f, 0.8f,ForgeDirection.EAST); - } - - 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/chemistry/RefluxCondenserTileEntity.java b/ihl/processing/chemistry/RefluxCondenserTileEntity.java deleted file mode 100644 index 83eb108..0000000 --- a/ihl/processing/chemistry/RefluxCondenserTileEntity.java +++ /dev/null @@ -1,148 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.ArrayList; -import java.util.List; - -import ic2.api.network.INetworkDataProvider; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ihl.utils.IHLUtils; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class RefluxCondenserTileEntity extends TileEntity implements IWrenchable, INetworkDataProvider, IFluidHandler{ - - private short facing=2; - private short lastFacing=2; - public FractionatorBottomTileEntity columnBottom; - - public RefluxCondenserTileEntity() - { - super(); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public List getNetworkedFields() - { - List fields = new ArrayList(); - fields.add("facing"); - return fields; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if(lastFacing!=facing) - { - IC2.network.get().updateTileEntityField(this, "facing"); - lastFacing=facing; - } - } - - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=side; - } - - - @Override - public short getFacing() { - return this.facing; - } - - - @Override - public void setFacing(short facing1) - { - facing=(short) Math.max(2,facing1); - if(IC2.platform.isSimulating()) - { - IC2.network.get().updateTileEntityField(this, "facing"); - } - } - - - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } - - - @Override - public float getWrenchDropRate() { - return 1F; - } - - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("refluxCondenser"); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - facing=nbttagcompound.getShort("facing"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - nbttagcompound.setShort("facing", facing); - } - - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return false; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return direction.equals(ForgeDirection.UP); - } - - @Override - public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return null; - } - - @Override - public FluidStack drain(ForgeDirection arg0, int arg1, boolean arg2) { - return null; - } - - @Override - public int fill(ForgeDirection direction, FluidStack fluidStack, boolean doFill) { - if(fluidStack!=null && fluidStack.getFluid()!=null && this.canFill(direction, fluidStack.getFluid()) && columnBottom!=null) - { - return columnBottom.fill(direction, fluidStack, doFill); - } - return 0; - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection arg0) - { - if(columnBottom!=null) - return columnBottom.getTankInfo(arg0); - else - return new FluidTankInfo[] {new FluidTankInfo(null, 8000)}; - } - -} diff --git a/ihl/processing/chemistry/SolarEvaporatorContainer.java b/ihl/processing/chemistry/SolarEvaporatorContainer.java deleted file mode 100644 index 4ecf44d..0000000 --- a/ihl/processing/chemistry/SolarEvaporatorContainer.java +++ /dev/null @@ -1,112 +0,0 @@ -package ihl.processing.chemistry; - -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; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class SolarEvaporatorContainer extends ContainerBase { - - protected SolarEvaporatorTileEntity tileEntity; - public int lastFluidAmount = -1; - public int lastFuel = -1; - public short lastProgress = -1; - private final static int height = 166; - public int lastNumberOfFluids = -1; - public int lastVisibleFluidID = -1; - public int lastVisibleFluidAmount = -1; - - public SolarEvaporatorContainer(EntityPlayer entityPlayer, SolarEvaporatorTileEntity tileEntity1) { - super(tileEntity1); - this.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.fluidItemsSlot, 0, 44, 14)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 44, 32)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillItemsSlot, 0, 44, 50)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 117, 32)); - - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - - if (this.tileEntity.getFluidTank().getFluid() != null - && this.tileEntity.getFluidTank().getFluidAmount() != this.lastFluidAmount) { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.getFluidTank().getFluid().getFluid().getID()); - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getFluidTank().getFluidAmount()); - } - - if (this.tileEntity.fuel != this.lastFuel) { - icrafting.sendProgressBarUpdate(this, 2, this.tileEntity.fuel); - } - - if (this.tileEntity.progress != this.lastProgress) { - icrafting.sendProgressBarUpdate(this, 3, this.tileEntity.progress); - } - if (this.tileEntity.visibleFluidId != this.lastVisibleFluidID) - { - icrafting.sendProgressBarUpdate(this, 4, this.tileEntity.visibleFluidId); - } - if (this.tileEntity.visibleFluidAmount != this.lastVisibleFluidAmount) - { - icrafting.sendProgressBarUpdate(this, 5, this.tileEntity.visibleFluidAmount); - } - } - - this.lastFluidAmount = this.tileEntity.getFluidTank().getFluidAmount(); - this.lastFuel = this.tileEntity.fuel; - this.lastProgress = this.tileEntity.progress; - this.lastVisibleFluidID=this.tileEntity.visibleFluidId; - this.lastVisibleFluidAmount=this.tileEntity.visibleFluidAmount; - } - - @Override - public void updateProgressBar(int index, int value) { - super.updateProgressBar(index, value); - - switch (index) { - case 0: - this.tileEntity.getFluidTank().setFluid(new FluidStack(FluidRegistry.getFluid(value), 1000)); - break; - case 1: - this.tileEntity.getFluidTank() - .setFluid(new FluidStack(this.tileEntity.getFluidTank().getFluid().getFluid(), value)); - break; - case 2: - this.tileEntity.fuel = value; - break; - case 3: - this.tileEntity.progress = (short) value; - break; - case 4: - this.tileEntity.visibleFluidId=value; - break; - case 5: - this.tileEntity.visibleFluidAmount=value; - break; - - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/chemistry/SolarEvaporatorGui.java b/ihl/processing/chemistry/SolarEvaporatorGui.java deleted file mode 100644 index e97f9e0..0000000 --- a/ihl/processing/chemistry/SolarEvaporatorGui.java +++ /dev/null @@ -1,78 +0,0 @@ -package ihl.processing.chemistry; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.util.DrawUtil; -import ic2.core.util.GuiTooltipHelper; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -@SideOnly(Side.CLIENT) -public class SolarEvaporatorGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", - "textures/gui/GUISolarEvaporator.png"); - private SolarEvaporatorContainer container; - - public SolarEvaporatorGui(SolarEvaporatorContainer container1) { - // the container is instanciated and passed to the superclass for - // handling - super(container1); - this.container = container1; - } - - @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.getActive()) { - this.drawTexturedModalRect(9, 16, 176, 0, 14, 14); - } - if (this.container.tileEntity.progress > 0) { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18), 18); - this.drawTexturedModalRect(99, 34, 198, 0, i1 + 1, 13); - } - - if (this.container.tileEntity.getTankAmount() > 0) { - FluidStack fluidStack = this.container.tileEntity.getFluidTank().getFluid(); - if (fluidStack != null) { - Fluid fluid = fluidStack.getFluid(); - if (fluid != null) { - - IIcon fluidIcon = fluid.getIcon(); - - if (fluidIcon != null) { - this.mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - int liquidHeight = this.container.tileEntity.gaugeLiquidScaled(47); - DrawUtil.drawRepeated(fluidIcon, (82), 16 + 47 - liquidHeight, 12.0D, liquidHeight, - this.zLevel); - this.mc.renderEngine.bindTexture(background); - } - } - String tooltip = StatCollector.translateToLocal(fluidStack.getFluid().getUnlocalizedName()) + ": " - + fluidStack.amount + "mB"; - GuiTooltipHelper.drawAreaTooltip(par1 - 90, par2 - 32, tooltip, xOffset - 8, yOffset - 15, xOffset + 2, - yOffset + 30); - } - } - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} \ No newline at end of file diff --git a/ihl/processing/chemistry/SolarEvaporatorTileEntity.java b/ihl/processing/chemistry/SolarEvaporatorTileEntity.java deleted file mode 100644 index 947a88a..0000000 --- a/ihl/processing/chemistry/SolarEvaporatorTileEntity.java +++ /dev/null @@ -1,108 +0,0 @@ -package ihl.processing.chemistry; - -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ihl.interfaces.IFluidTankVisual; -import ihl.utils.IHLUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.EnumSkyBlock; - -public class SolarEvaporatorTileEntity extends EvaporatorTileEntity implements IFluidTankVisual { - public int visibleFluidId = -1; - public int visibleFluidAmount = 1; - - public SolarEvaporatorTileEntity(){ - super(); - this.fuelSlot = null; - this.maxProgress = 4500; - } - - @Override - public List getNetworkedFields() - { - List ret = super.getNetworkedFields(); - ret.add("visibleFluidId"); - ret.add("visibleFluidAmount"); - return ret; - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - if(this.fluidTank.getFluid()!=null && (visibleFluidId!=this.fluidTank.getFluid().getFluid().getID() || visibleFluidAmount!=this.fluidTank.getFluidAmount())) - { - visibleFluidId = this.fluidTank.getFluid().getFluid().getID(); - visibleFluidAmount = this.fluidTank.getFluidAmount(); - IC2.network.get().updateTileEntityField(this, "visibleFluidId"); - IC2.network.get().updateTileEntityField(this, "visibleFluidAmount"); - } - else if(this.fluidTank.getFluid()==null && visibleFluidId!=-1) - { - visibleFluidId=-1; - IC2.network.get().updateTileEntityField(this, "visibleFluidId"); - } - } - @Override - public boolean isBurning() - { - return this.worldObj.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, xCoord, yCoord, zCoord)>=15; - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) - { - return new SolarEvaporatorContainer(entityPlayer, this); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) - { - return new SolarEvaporatorGui(new SolarEvaporatorContainer(entityPlayer, this)); - } - - @Override - public short getFacing() - { - return 3; - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return false; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("solarEvaporator"); - } - - @Override - public int getVisibleFluidId() { - return this.visibleFluidId; - } - - @Override - public int getVisibleFluidAmount() { - return this.visibleFluidAmount; - } - - @Override - public float getRenderLiquidLevel() - { - return (float)this.visibleFluidAmount/(float)this.fluidTank.getCapacity()/2; - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } -} diff --git a/ihl/processing/invslots/IHLInvSlotOutput.java b/ihl/processing/invslots/IHLInvSlotOutput.java deleted file mode 100644 index d5186e2..0000000 --- a/ihl/processing/invslots/IHLInvSlotOutput.java +++ /dev/null @@ -1,166 +0,0 @@ -package ihl.processing.invslots; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import ic2.core.block.TileEntityInventory; -import ic2.core.block.invslot.InvSlotOutput; -import ihl.recipes.RecipeOutputItemStack; -import ihl.utils.IHLUtils; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -public class IHLInvSlotOutput extends InvSlotOutput { - - 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) { - if (itemOutputs == null || itemOutputs.isEmpty()) { - return true; - } - Iterator ioi = itemOutputs.iterator(); - if (this.size() >= itemOutputs.size()) { - Object rois; - if (ioi.hasNext()) { - rois = ioi.next(); - } else { - return true; - } - for (int i = 0; i < this.size(); i++) { - if (this.get(i) == null || (this.objectMatchesSlot(rois, i) - && this.get(i).stackSize + this.getAmoutOfObject(rois) < this.getStackSizeLimit() - && this.get(i).stackSize + this.getAmoutOfObject(rois) <= this.get(i).getMaxStackSize())) { - if (ioi.hasNext()) { - rois = ioi.next(); - } else { - return true; - } - } else { - if (i == this.size() - 1) { - return false; - } - } - } - - } - return false; - } - - private float getAmoutOfObject(Object obj) { - if (obj instanceof ItemStack) { - return ((ItemStack) obj).stackSize; - } else if (obj instanceof RecipeOutputItemStack) { - return ((RecipeOutputItemStack) obj).quantity; - } - return Short.MAX_VALUE; - } - - public boolean objectMatchesSlot(Object obj, int slot) { - if (this.get(slot) == null) { - return true; - } else { - if (obj instanceof ItemStack) { - return IHLUtils.isItemStacksIsEqual(this.get(slot), (ItemStack) obj, true); - } else if (obj instanceof RecipeOutputItemStack) { - return ((RecipeOutputItemStack) obj).matches(this.get(slot)); - } - } - return false; - } - - public void add(RecipeOutputItemStack rois) { - for (int i = 0; i < this.size(); i++) { - if (this.get(i) == null || (this.objectMatchesSlot(rois, i) - && this.get(i).stackSize + this.getAmoutOfObject(rois) < this.getStackSizeLimit())) { - this.add(i, rois); - break; - } - } - } - - private void add(int i, RecipeOutputItemStack rois) { - long key = (Item.getIdFromItem(rois.itemStack.getItem()) << 32) + rois.itemStack.getItemDamage(); - float amount = 0f; - if (this.substanceAmount.containsKey(key)) { - amount = this.substanceAmount.get(key); - } - amount += rois.quantity; - while (amount >= 1) { - amount--; - this.add(rois.itemStack.copy()); - } - this.substanceAmount.put(key, amount); - } - - @Override - @SuppressWarnings("rawtypes") - public int add(List itemOutputs) { - if (itemOutputs == null || itemOutputs.isEmpty()) { - return 0; - } - Iterator ioi = itemOutputs.iterator(); - if (this.size() >= itemOutputs.size() && ioi.hasNext()) { - Object rois = ioi.next(); - for (int i = 0; i < this.size(); i++) { - if (this.get(i) == null || (this.objectMatchesSlot(rois, i) - && this.get(i).stackSize + this.getAmoutOfObject(rois) < this.getStackSizeLimit())) { - if (rois instanceof ItemStack) { - this.add(((ItemStack) rois).copy()); - } else if (rois instanceof RecipeOutputItemStack) { - this.add(i, (RecipeOutputItemStack) rois); - } - if (ioi.hasNext()) { - rois = ioi.next(); - } else { - return itemOutputs.size(); - } - } else { - if (i == this.size() - 1) { - return 0; - } - } - } - - } - return 0; - } - - @Override - public void readFromNbt(NBTTagCompound nbtTagCompound) { - super.readFromNbt(nbtTagCompound); - NBTTagList amountTagList = nbtTagCompound.getTagList("substanceAmountMap", 10); - for (int i = 0; i < amountTagList.tagCount(); i++) { - if (amountTagList.getCompoundTagAt(i).hasKey("substanceKey")) { - long substanceKey = amountTagList.getCompoundTagAt(i).getLong("substanceKey"); - float substanceAmount = amountTagList.getCompoundTagAt(i).getFloat("substanceAmount"); - this.substanceAmount.put(substanceKey, substanceAmount); - } - } - } - - @Override - public void writeToNbt(NBTTagCompound nbtTagCompound) { - super.writeToNbt(nbtTagCompound); - NBTTagList sAmountsList = new NBTTagList(); - Iterator> entrySetIterator = this.substanceAmount.entrySet().iterator(); - while (entrySetIterator.hasNext()) { - Entry entry = entrySetIterator.next(); - NBTTagCompound tag = new NBTTagCompound(); - tag.setLong("substanceKey", entry.getKey()); - tag.setFloat("substanceAmount", entry.getValue()); - sAmountsList.appendTag(tag); - } - nbtTagCompound.setTag("substanceAmountMap", sAmountsList); - } -} diff --git a/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java b/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java deleted file mode 100644 index 7bb6ecc..0000000 --- a/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java +++ /dev/null @@ -1,271 +0,0 @@ -package ihl.processing.invslots; - -import java.util.Iterator; - -import org.apache.commons.lang3.mutable.MutableObject; - -import ic2.core.block.TileEntityInventory; -import ic2.core.block.invslot.InvSlotConsumableLiquid; -import ic2.core.util.StackUtil; -import ihl.utils.IHLUtils; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidContainerItem; - -public class InvSlotConsumableLiquidIHL extends InvSlotConsumableLiquid{ - - private OpType opType; - private String additionalInputs; - - public InvSlotConsumableLiquidIHL(TileEntityInventory base1, String name1,int oldStartIndex1, Access access1, int count,InvSide preferredSide1, OpType opType1) - { - super(base1, name1, oldStartIndex1, access1, count, preferredSide1, opType1); - opType=opType1; - } - - public InvSlotConsumableLiquidIHL(TileEntityInventory base1, String name1,int oldStartIndex1, Access access1, int count,InvSide preferredSide1, OpType opType1, String additionalInputs1) - { - super(base1, name1, oldStartIndex1, access1, count, preferredSide1, opType1); - opType=opType1; - additionalInputs=additionalInputs1; - } - - @Override - public FluidStack drain(Fluid fluid, int maxAmount, MutableObject output, boolean simulate) - { - if(output!=null) - { - output.setValue((ItemStack)null); - } - - if (this.opType != InvSlotConsumableLiquid.OpType.Drain && this.opType != InvSlotConsumableLiquid.OpType.Both) - { - return null; - } - else - { - ItemStack stack = this.get(); - - if (stack == null) - { - return null; - } - else if (!FluidContainerRegistry.isFilledContainer(stack)) - { - if (stack.getItem() instanceof IFluidContainerItem) - { - IFluidContainerItem var9 = (IFluidContainerItem)stack.getItem(); - - if (var9.getFluid(stack) == null) - { - return null; - } - else if (fluid != null && var9.getFluid(stack).getFluid() != fluid) - { - return null; - } - else if (!this.acceptsLiquid(var9.getFluid(stack).getFluid())) - { - return null; - } - else - { - ItemStack singleStack = StackUtil.copyWithSize(stack, 1); - FluidStack fluidStack = var9.drain(singleStack, maxAmount, true); - - if (fluidStack != null && fluidStack.amount > 0) - { - if (singleStack.stackSize <= 0) - { - if (!simulate) - { - --stack.stackSize; - } - } - else if (var9.getFluid(singleStack) == null) - { - if(output!=null) - { - output.setValue(singleStack); - } - if (!simulate) - { - --stack.stackSize; - } - } - else - { - if (stack.stackSize > 1) - { - return null; - } - - if (!simulate) - { - this.put(singleStack); - } - } - - if (stack.stackSize <= 0) - { - this.put((ItemStack)null); - } - - return fluidStack; - } - else - { - return null; - } - } - } - else - { - return null; - } - } - else - { - FluidStack container = FluidContainerRegistry.getFluidForFilledItem(stack); - - if (container != null && (fluid == null || fluid == container.getFluid())) - { - if (!this.acceptsLiquid(container.getFluid())) - { - return null; - } - else if (container.amount > 0 && container.amount <= maxAmount) - { - if (stack.getItem().hasContainerItem(stack) && output!=null) - { - output.setValue(stack.getItem().getContainerItem(stack)); - } - else - { - ItemStack emptystack = FluidContainerRegistry.drainFluidContainer(stack); - if(emptystack!=null && output!=null) - { - output.setValue(emptystack); - } - } - - if (!simulate) - { - --stack.stackSize; - - if (stack.stackSize <= 0) - { - this.put((ItemStack)null); - } - } - - return container; - } - else - { - return null; - } - } - else - { - return null; - } - } - } - } - - @Override - public boolean accepts(ItemStack stack) - { - if (stack == null) - { - return true; - } - Item item = stack.getItem(); - if (item == null) - { - return false; - } - else - { - if(this.additionalInputs!=null) - { - String fon = IHLUtils.getFirstOreDictName(stack); - if(fon!=null && fon.contains(additionalInputs)) - { - return true; - } - } - if (this.opType == InvSlotConsumableLiquid.OpType.Drain || this.opType == InvSlotConsumableLiquid.OpType.Both) - { - FluidStack containerItem = null; - if (FluidContainerRegistry.isFilledContainer(stack)) - { - containerItem = FluidContainerRegistry.getFluidForFilledItem(stack); - } - else if (item instanceof IFluidContainerItem) - { - containerItem = ((IFluidContainerItem)item).getFluid(stack); - } - - if (containerItem != null && containerItem.amount > 0) - { - return true; - } - } - if (this.opType == InvSlotConsumableLiquid.OpType.Fill || this.opType == InvSlotConsumableLiquid.OpType.Both) - { - if (FluidContainerRegistry.isEmptyContainer(stack)) - { - if (this.getPossibleFluids() == null) - { - return true; - } - - Iterator containerItem1 = this.getPossibleFluids().iterator(); - - while (containerItem1.hasNext()) - { - Fluid prevFluid = containerItem1.next(); - - if (FluidContainerRegistry.fillFluidContainer(new FluidStack(prevFluid, Integer.MAX_VALUE), stack) != null) - { - return true; - } - } - } - else if (item instanceof IFluidContainerItem) - { - IFluidContainerItem containerItem2 = (IFluidContainerItem)item; - FluidStack prevFluid1 = containerItem2.getFluid(stack); - - if (prevFluid1 == null || containerItem2.getCapacity(stack) > prevFluid1.amount) - { - if (this.getPossibleFluids() == null) - { - return true; - } - - ItemStack singleStack = StackUtil.copyWithSize(stack, 1); - Iterator i$ = this.getPossibleFluids().iterator(); - - while (i$.hasNext()) - { - Fluid fluid = i$.next(); - - if (containerItem2.fill(singleStack, new FluidStack(fluid, Integer.MAX_VALUE), false) > 0) - { - return true; - } - } - } - } - } - return false; - } - } - -} diff --git a/ihl/processing/invslots/InvSlotUpgradeIHL.java b/ihl/processing/invslots/InvSlotUpgradeIHL.java deleted file mode 100644 index 5c1fff9..0000000 --- a/ihl/processing/invslots/InvSlotUpgradeIHL.java +++ /dev/null @@ -1,61 +0,0 @@ -package ihl.processing.invslots; - -import ic2.core.Ic2Items; -import ic2.core.block.TileEntityInventory; -import ic2.core.block.invslot.InvSlot; -import ihl.utils.IHLUtils; -import net.minecraft.item.ItemStack; - -public class InvSlotUpgradeIHL extends InvSlot { - - public InvSlotUpgradeIHL(int count) { - super(count); - } - - public InvSlotUpgradeIHL(TileEntityInventory base, int oldStartIndex, Access access, int count, InvSide side) { - super(base, "invSlotUpgrade", oldStartIndex, access, count, side); - } - - public double getPowerConsumtionMultiplier() { - double base = 1d; - for (int i = 0; i < this.size(); i++) { - if (IHLUtils.isItemStacksIsEqual(this.get(i), Ic2Items.overclockerUpgrade, false)) { - int i1 = this.get(i).stackSize; - while (i1-- > 0 && base < 600) { - base *= 1.6f; - } - } - } - return base; - } - - public float getProgressMultiplier() { - float base = 1f; - for (int i = 0; i < this.size(); i++) { - if (IHLUtils.isItemStacksIsEqual(this.get(i), Ic2Items.overclockerUpgrade, false)) { - int i1 = this.get(i).stackSize; - while (i1-- > 0 && base < 600) { - base *= 1.428571429f; - } - } - } - return base; - } - - public int getAdditionalEnergyStorage() { - int base = 0; - for (int i = 0; i < this.size(); i++) { - if (IHLUtils.isItemStacksIsEqual(this.get(i), Ic2Items.energyStorageUpgrade, false)) { - base += this.get(i).stackSize * 10000; - } - } - return base; - } - - @Override - public boolean accepts(ItemStack stack) { - return IHLUtils.isItemStacksIsEqual(stack, Ic2Items.overclockerUpgrade, false) || - IHLUtils.isItemStacksIsEqual(stack, Ic2Items.energyStorageUpgrade, false); - } - -} diff --git a/ihl/processing/invslots/SlotInvSlotIronWorkbench.java b/ihl/processing/invslots/SlotInvSlotIronWorkbench.java deleted file mode 100644 index 7f00e06..0000000 --- a/ihl/processing/invslots/SlotInvSlotIronWorkbench.java +++ /dev/null @@ -1,32 +0,0 @@ -package ihl.processing.invslots; - -import ic2.core.slot.SlotInvSlot; -import ihl.flexible_cable.IronWorkbenchInvSlot; -import ihl.flexible_cable.IronWorkbenchTileEntity; -import net.minecraft.entity.player.EntityPlayer; - -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/invslots/SlotInvSlotOutputInProgress.java b/ihl/processing/invslots/SlotInvSlotOutputInProgress.java deleted file mode 100644 index 25c0673..0000000 --- a/ihl/processing/invslots/SlotInvSlotOutputInProgress.java +++ /dev/null @@ -1,23 +0,0 @@ -package ihl.processing.invslots; - -import ic2.core.slot.SlotInvSlot; -import ihl.flexible_cable.IronWorkbenchInvSlot; -import net.minecraft.entity.player.EntityPlayer; - -public class SlotInvSlotOutputInProgress extends SlotInvSlot { - - public IronWorkbenchInvSlot invSlot; - - public SlotInvSlotOutputInProgress(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(); - } -} diff --git a/ihl/processing/metallurgy/AchesonFurnaceGui.java b/ihl/processing/metallurgy/AchesonFurnaceGui.java deleted file mode 100644 index 6f8238a..0000000 --- a/ihl/processing/metallurgy/AchesonFurnaceGui.java +++ /dev/null @@ -1,46 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -public class AchesonFurnaceGui extends GuiContainer { - protected static final ResourceLocation achesonFurnaceBackground = new ResourceLocation("ihl", "textures/gui/GUIAchesonFurnace.png"); - private MachineBaseContainer container; - - public AchesonFurnaceGui(MachineBaseContainer machineBaseContainer) { - super(machineBaseContainer); - this.container=machineBaseContainer; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(achesonFurnaceBackground); - int i1; - if (this.container.tileEntity.getEnergy() > 0D) - { - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(8, 6 + 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(70,34, 197, 0, i1 + 1, 13); - } - fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ihl.gui.achesonFurnance"), 40, 12, 16768125); - } - - @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(achesonFurnaceBackground); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/ihl/processing/metallurgy/AchesonFurnanceContainer.java b/ihl/processing/metallurgy/AchesonFurnanceContainer.java deleted file mode 100644 index 2580c6c..0000000 --- a/ihl/processing/metallurgy/AchesonFurnanceContainer.java +++ /dev/null @@ -1,16 +0,0 @@ -package ihl.processing.metallurgy; - -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; - -public class AchesonFurnanceContainer extends MachineBaseContainer { - - public AchesonFurnanceContainer(EntityPlayer entityPlayer, - AchesonFurnanceTileEntity tileEntity1) { - super(entityPlayer, tileEntity1); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 40, 22)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 40, 40)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 98, 32)); - } - -} diff --git a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java deleted file mode 100644 index 75efd70..0000000 --- a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java +++ /dev/null @@ -1,101 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.recipe.IRecipeInput; -import ic2.core.ContainerBase; -import ihl.IHLMod; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.recipes.RecipeOutputItemStack; -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; - -public class AchesonFurnanceTileEntity extends MachineBaseTileEntity { - - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("achesonfurnace"); - public final IHLInvSlotOutput outputSlot; - - public AchesonFurnanceTileEntity() { - super(2); - this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); - } - - public static void addRecipe(IRecipeInput input1, IRecipeInput input2, String output1) { - recipeManager.addRecipe(new UniversalRecipeInput(null, new IRecipeInput[] { input1, input2 }), - new UniversalRecipeOutput(null, new ItemStack[] { IHLUtils.getThisModItemStack(output1) }, 20)); - } - - @Override - public String getStartSoundFile() { - return "Machines/Electro Furnace/ElectroFurnaceLoop.ogg"; - } - - @Override - public String getLoopSoundFile() { - return null; - } - - @Override - public String getStopSoundFile() { - return null; - } - - @Override - public String getInventoryName() { - return "AchesonFurnance"; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new AchesonFurnaceGui(new AchesonFurnanceContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new AchesonFurnanceContainer(player, this); - } - - @Override - public void operate() { - ItemStack crucible = input.getItemStack(IHLMod.crucible); - if (crucible != null) { - ((Crucible) crucible.getItem()).processContent(crucible, this); - return; - } - List output = recipeManager - .getOutputFor(getInput()).getItemOutputs(); - List rinput = recipeManager.getRecipeInput(getInput()).getItemInputs(); - for (int i = 0; i < rinput.size(); i++) { - this.input.consume(rinput.get(i)); - } - this.outputSlot.add(output); - } - - @Override - public boolean canOperate() { - return this.getOutput() != null; - } - - @Override - public List[] getInput() { - return new List[] { null, this.input.getItemStackList() }; - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - @Override - public UniversalRecipeOutput getOutput() { - return AchesonFurnanceTileEntity.recipeManager.getOutputFor(this.getInput()); - } -} diff --git a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java deleted file mode 100644 index a546b0a..0000000 --- a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java +++ /dev/null @@ -1,272 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.Iterator; -import java.util.List; - -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergySink; -import ic2.api.network.INetworkClientTileEntityEventListener; -import ic2.core.IC2; -import ic2.core.IHasGui; -import ic2.core.block.invslot.InvSlot; -import ic2.core.block.invslot.InvSlot.Access; -import ihl.IHLMod; -import ihl.flexible_cable.FlexibleCableHolderBaseTileEntity; -import ihl.flexible_cable.NodeEntity; -import ihl.processing.invslots.InvSlotUpgradeIHL; -import ihl.utils.IHLInvSlotDischarge; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - -public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBaseTileEntity - implements IHasGui, INetworkClientTileEntityEventListener, IEnergySink { - - public final IHLInvSlotDischarge dischargeSlot; - public final InvSlotUpgradeIHL upgradeSlot; - public short progress; - protected short operationLength = 6000; - protected double energyConsume = 1d; - public double energy = 0d; - public int maxStorage = 128; - private boolean addedToEnergyNet = false; - - public BasicElectricMotorTileEntity() { - super(); - energyConsume = IHLMod.config.machineryEnergyConsume/100d; - dischargeSlot = new IHLInvSlotDischarge(this, 1, Access.I, 4, InvSlot.InvSide.BOTTOM); - upgradeSlot = new InvSlotUpgradeIHL(this, 1, Access.I, 4, InvSlot.InvSide.BOTTOM); - } - - @Override - public String getInventoryName() { - return "Lathe"; - } - - public boolean enableUpdateEntity() { - return IC2.platform.isSimulating(); - } - - @Override - public void onLoaded() { - super.onLoaded(); - if (IC2.platform.isSimulating() && !this.addedToEnergyNet) { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - this.addedToEnergyNet = true; - } - } - - @Override - public void onUnloaded() { - if (IC2.platform.isSimulating() && this.addedToEnergyNet) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - this.addedToEnergyNet = false; - } - - super.onUnloaded(); - } - - @SuppressWarnings("unchecked") - @Override - public void setFacing(short facing1) { - double d = 0.3D; - double f = -0.1D; - if (IC2.platform.isSimulating() && this.addedToEnergyNet) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - this.addedToEnergyNet = false; - } - double range = 2D; - AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(connectionX - range, connectionY - range, - connectionZ - range, connectionX + range, connectionY + range, connectionZ + range); - List nodeList = worldObj.getEntitiesWithinAABB(NodeEntity.class, searchArea); - super.setFacing(facing1); - switch (getFacing()) { - case 4: - setConnectionX(this.xCoord + 0.5D); - setConnectionY(this.yCoord + d); - setConnectionZ(this.zCoord + 1D - f); - break; - case 5: - setConnectionX(this.xCoord + 0.5D); - setConnectionY(this.yCoord + d); - setConnectionZ(this.zCoord + f); - break; - case 2: - setConnectionX(this.xCoord + 1D - f); - setConnectionY(this.yCoord + d); - setConnectionZ(this.zCoord + 0.5D); - break; - case 3: - setConnectionX(this.xCoord + f); - setConnectionY(this.yCoord + d); - setConnectionZ(this.zCoord + 0.5D); - break; - default: - setConnectionX(this.xCoord + 1D - f); - setConnectionY(this.yCoord + d); - setConnectionZ(this.zCoord + 0.5D); - break; - - } - if (!nodeList.isEmpty()) { - Iterator ei = nodeList.iterator(); - while (ei.hasNext()) { - NodeEntity ne = ei.next(); - if ((ne.prevAnchorEntity == null || ne.nextAnchorEntity == null) - && this.cableListContains(ne.getChainUniqueID())) { - ne.setVirtualNodePos(connectionX, connectionY, connectionZ); - } - } - } - if (IC2.platform.isSimulating() && !this.addedToEnergyNet) { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - this.addedToEnergyNet = true; - } - } - - @Override - public double getDemandedEnergy() { - if(this.getMaxStorage() - this.energy <= 1d) - { - return 0d; - } - return this.getMaxStorage() - this.energy; - } - - @Override - public int getSinkTier() { - return 4; - } - - @Override - public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { - if (this.energy < this.getMaxStorage()) { - this.energy += amount; - return 0.0D; - } else { - return amount; - } - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing() != (short) side; - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - nbt.setShort("progress", this.progress); - nbt.setDouble("energy", this.energy); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) { - super.readFromNBT(nbt); - this.progress = nbt.getShort("progress"); - this.energy = nbt.getDouble("energy"); - } - - @Override - public void onNetworkEvent(EntityPlayer player, int event) { - switch (event) { - case 0: - break; - } - } - - public abstract void operate(); - - @Override - public void updateEntityServer() { - 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.getMaxStorage()) { - this.energy += energyConsume * 10D; - this.getGrid().drawEnergy(energyConsume * 10D, this); - } - if (this.canOperate() && this.energy >= this.energyConsume) { - this.energy -= this.energyConsume * this.upgradeSlot.getPowerConsumtionMultiplier(); - if (this.progress == 0) { - IC2.network.get().initiateTileEntityEvent(this, 0, true); - } - this.progress+=(short)(10*this.upgradeSlot.getProgressMultiplier()); - 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; - } - } - - } - - private double getMaxStorage() { - return maxStorage+this.upgradeSlot.getAdditionalEnergyStorage(); - } - - public abstract List[] getInput(); - - public abstract boolean canOperate(); - - @Override - public void onGuiClosed(EntityPlayer arg0) { - } - - public int getEnergy() { - return (int) this.energy; - } - - public int getGUIEnergy(int i) { - if (this.energy < Float.MAX_VALUE) { - return Math.round((float) (this.energy / this.getMaxStorage() * i)); - } else { - return Math.round((float) (this.energy / this.getMaxStorage()) * i); - } - } - - public int gaugeProgressScaled(int i) { - return this.progress * i / this.operationLength; - } - - public void setEnergy(int value) { - this.energy = value; - } - - @Override - public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { - return true; - } - - @Override - public double getMaxAllowableVoltage() { - return 64000D; - } - - @Override - public double getEnergyAmountThisNodeWant() { - return this.getMaxStorage()-this.energy; - } - - public double drawEnergyToGrid(double amount) { - 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 deleted file mode 100644 index 710a708..0000000 --- a/ihl/processing/metallurgy/CoilerContainer.java +++ /dev/null @@ -1,65 +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 CoilerContainer extends ContainerBase { - - public CoilerTileEntity tileEntity; - private short lastEnergy = -1; - private final static int height=166; - - public CoilerContainer(EntityPlayer entityPlayer, - CoilerTileEntity lathePart1TileEntity) { - super(lathePart1TileEntity); - tileEntity=lathePart1TileEntity; - 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(lathePart1TileEntity.output, 0, 69, 22)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - if (this.tileEntity.getEnergy() != this.lastEnergy) - { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); - } - } - this.lastEnergy = (short) this.tileEntity.getEnergy(); - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 1: - this.tileEntity.setEnergy(value); - break; - } - } - -} diff --git a/ihl/processing/metallurgy/CoilerGui.java b/ihl/processing/metallurgy/CoilerGui.java deleted file mode 100644 index b635506..0000000 --- a/ihl/processing/metallurgy/CoilerGui.java +++ /dev/null @@ -1,48 +0,0 @@ -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; - -public class CoilerGui extends GuiContainer { - - private CoilerContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUICoiler.png"); - - public CoilerGui(CoilerContainer 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); - fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ihl.gui.coiler"), 40, 12, 16768125); - this.mc.renderEngine.bindTexture(tex); - int i1; - if (this.container.tileEntity.getEnergy() > 0D) - { - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(39, 55 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.coiler.tip")); - } - - @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); - } -} diff --git a/ihl/processing/metallurgy/CoilerModel.java b/ihl/processing/metallurgy/CoilerModel.java deleted file mode 100644 index 9c1721e..0000000 --- a/ihl/processing/metallurgy/CoilerModel.java +++ /dev/null @@ -1,103 +0,0 @@ -package ihl.processing.metallurgy; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class CoilerModel extends ModelBase -{ - //fields - IHLModelRenderer Base; - IHLModelRenderer RotatingPart2; - IHLModelRenderer MotorPart1; - IHLModelRenderer MotorPart2; - IHLModelRenderer Belt; - IHLModelRenderer Belt2; - IHLModelRenderer CoilRotating; - IHLModelRenderer Coil; - - public CoilerModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 0); - setTextureOffset("Base.Shape3", 0, 0); - setTextureOffset("Base.Shape2", 0, 0); - setTextureOffset("Base.Shape16", 0, 0); - setTextureOffset("RotatingPart2.PipeN1", 0, 0); - setTextureOffset("RotatingPart2.PipeN7", 49, 23); - setTextureOffset("RotatingPart2.PipeN4", 0, 17); - setTextureOffset("RotatingPart2.PipeN14", 0, 19); - setTextureOffset("RotatingPart2.PipeN17", 0, 17); - setTextureOffset("MotorPart1.PipeN41", 0, 0); - setTextureOffset("MotorPart1.PipeN12", 0, 0); - setTextureOffset("MotorPart1.PipeN13", 0, 0); - setTextureOffset("MotorPart2.Shape4", 0, 24); - setTextureOffset("MotorPart2.Shape7", 0, 9); - setTextureOffset("MotorPart2.Shape10", 0, 9); - setTextureOffset("Belt.Shape12", 0, 0); - setTextureOffset("Belt2.Shape13", 0, 0); - setTextureOffset("CoilRotating.PipeN15", 22, 19); - setTextureOffset("Coil.Shape1", 22, 30); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); - Base.addBox("Shape3", -5F, 0F, -7F, 4, 7, 1); - Base.addBox("Shape2", -5.5F, -1F, 7F, 5, 8, 1); - Base.addBox("Shape16", 3F, 3F, -6F, 3, 4, 1); - RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); - RotatingPart2.setRotationPoint(-3F, 18F, -7F); - setRotation(RotatingPart2, 0F, 0F, 0F); - RotatingPart2.mirror = true; - RotatingPart2.addTube("PipeN1", -0.5F, -0.5F, 0F, 1, 1, 14, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN7", -2.5F, -2.5F, -1F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN4", -4F, -4F, 2F, 8, 8, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN14", -4F, -4F, 12F, 8, 8, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN17", -1F, -1F, 3F, 2, 2, 9, 0F,1F,ForgeDirection.NORTH); - MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); - MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); - setRotation(MotorPart1, 0F, 0F, 0F); - MotorPart1.mirror = true; - MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); - MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); - MotorPart2.setRotationPoint(0F, 16F, 0F); - setRotation(MotorPart2, 0F, 0F, 0F); - MotorPart2.mirror = true; - MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); - MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); - MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); - Belt = new IHLModelRenderer(this, "Belt"); - Belt.setRotationPoint(-3F, 15.5F, -7.9F); - setRotation(Belt, 0F, 0F, 0.45F); - Belt.mirror = true; - Belt.addBox("Shape12", 0.5F, 0F, 0F, 8, 1, 1); - Belt2 = new IHLModelRenderer(this, "Belt2"); - Belt2.setRotationPoint(-3F, 19.5F, -7.9F); - setRotation(Belt2, 0F, 0F, 0.19F); - Belt2.mirror = true; - Belt2.addBox("Shape13", 0F, 0F, 0F, 8, 1, 1); - CoilRotating = new IHLModelRenderer(this, "CoilRotating"); - CoilRotating.setRotationPoint(-3F, 18F, -7F); - setRotation(CoilRotating, 0F, 0F, 0F); - CoilRotating.mirror = true; - CoilRotating.addTube("PipeN15", -2F, -2F, 3F, 4, 4, 9, 0F,1F,ForgeDirection.NORTH); - Coil = new IHLModelRenderer(this, "Coil"); - Coil.setRotationPoint(-0.25F, 16F, 0F); - setRotation(Coil, 0F, 0F, -0.2F); - Coil.mirror = true; - Coil.addTube("Shape1", -8F, -0.25F, -0.5F, 5, 1, 1, 0F,1F,ForgeDirection.WEST); - } - - 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/CoilerRender.java b/ihl/processing/metallurgy/CoilerRender.java deleted file mode 100644 index 26ee32f..0000000 --- a/ihl/processing/metallurgy/CoilerRender.java +++ /dev/null @@ -1,80 +0,0 @@ -package ihl.processing.metallurgy; -import org.lwjgl.opengl.GL11; - -import ic2.api.tile.IWrenchable; -import ihl.IHLModInfo; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -public class CoilerRender extends TileEntitySpecialRenderer{ -private CoilerModel model = new CoilerModel(); -private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/coiler.png"); -private final float scale=1F/16F; - - public CoilerRender() {} - - - @Override - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par8) - { - int rotation = 0; - if(tile.getWorldObj() != null) - { - switch (((IWrenchable)tile).getFacing()) - { - case 2: - rotation = 0; - break; - case 5: - rotation = 1; - break; - case 3: - rotation = 2; - break; - case 4: - rotation = 3; - break; - default: - rotation = 0; - } - } - else - { - return; - } - CoilerTileEntity cte = (CoilerTileEntity)tile; - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F); - - bindTexture(tex); - model.Base.render(scale); - model.Belt.render(scale); - model.Belt2.render(scale); - if(cte.getActive()) - { - model.Coil.render(scale); - model.CoilRotating.rotateAngleZ+=0.02F; - model.CoilRotating.render(scale); - model.RotatingPart2.rotateAngleZ+=0.02F; - model.MotorPart1.rotateAngleZ+=0.03F; - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - } - else - { - - if(cte.hasCoil) - { - model.CoilRotating.render(scale); - } - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - } - model.RotatingPart2.render(scale); - GL11.glPopMatrix(); //end - - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/CoilerTileEntity.java b/ihl/processing/metallurgy/CoilerTileEntity.java deleted file mode 100644 index 3853a0e..0000000 --- a/ihl/processing/metallurgy/CoilerTileEntity.java +++ /dev/null @@ -1,155 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.block.invslot.InvSlotOutput; -import ihl.interfaces.IWire; -import ihl.utils.IHLUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IProductionLine{ - - public final InvSlotOutput output; - private int activeTimer=0; - public boolean hasCoil=false; - - public CoilerTileEntity() - { - super(); - this.output = new InvSlotOutput(this, "output", 1, 1); - } - - - @Override - public String getInventoryName() { - return "Coiler"; - } - - @Override - public List getNetworkedFields() - { - List fields = super.getNetworkedFields(); - fields.add("hasCoil"); - return fields; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("coiler"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new CoilerGui(new CoilerContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) - { - return new CoilerContainer(player, this); - } - - @Override - public boolean canOperate() - { - return false; - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - if(activeTimer>0) - { - activeTimer--; - } - else - { - setActive(false); - } - if(this.output.isEmpty() && hasCoil==true) - { - this.hasCoil=false; - IC2.network.get().updateTileEntityField(this, "hasCoil"); - } - else if(!this.output.isEmpty() && hasCoil==false) - { - this.hasCoil=true; - IC2.network.get().updateTileEntityField(this, "hasCoil"); - } - } - - @Override - public void operate() - {} - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public List[] getInput() - { - return null; - } - - @Override - public boolean canProcess(ItemStack cable) { - if(this.energy>1D && cable.getItem() instanceof IWire) - { - if(this.output.isEmpty()) - { - return true; - } - else if(this.output.get().getItem() instanceof IWire) - { - return ((IWire)this.output.get().getItem()).isSameWire(this.output.get(), cable); - } - else - { - return this.output.get().isItemEqual(cable); - } - } - return false; - } - - - @Override - public void process(ItemStack cable) { - if(cable.getItem() instanceof IWire) - { - this.energy-=1D; - if(this.output.isEmpty()) - { - setActive(true); - activeTimer=800; - this.output.put(cable); - this.hasCoil=true; - IC2.network.get().updateTileEntityField(this, "hasCoil"); - } - else - { - setActive(true); - activeTimer=800; - int length = this.output.get().stackTagCompound.getInteger(((IWire)this.output.get().getItem()).getTag()); - int fullLength = this.output.get().stackTagCompound.getInteger(((IWire)this.output.get().getItem()).getTagSecondary()); - int lengthToAdd = cable.stackTagCompound.getInteger(((IWire)cable.getItem()).getTag()); - int fullLengthToAdd = cable.stackTagCompound.getInteger(((IWire)cable.getItem()).getTagSecondary()); - this.output.get().stackTagCompound.setInteger(((IWire)this.output.get().getItem()).getTag(), length+lengthToAdd); - this.output.get().stackTagCompound.setInteger(((IWire)this.output.get().getItem()).getTagSecondary(),fullLength+fullLengthToAdd); - } - } - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - -} diff --git a/ihl/processing/metallurgy/Crucible.java b/ihl/processing/metallurgy/Crucible.java deleted file mode 100644 index 220b505..0000000 --- a/ihl/processing/metallurgy/Crucible.java +++ /dev/null @@ -1,366 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.item.IItemHudInfo; -import ic2.api.recipe.IRecipeInput; -import ic2.api.recipe.RecipeInputOreDict; -import ic2.core.IC2; -import ic2.core.IHasGui; -import ic2.core.item.IHandHeldInventory; -import ic2.core.util.LiquidUtil; -import ic2.core.util.StackUtil; -import ihl.IHLCreativeTab; -import ihl.IHLModInfo; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -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.IFluidContainerItem; -import net.minecraftforge.fluids.IFluidHandler; - -public class Crucible extends Item implements IHandHeldInventory, IFluidContainerItem, IItemHudInfo{ - - public int capacity=864; - private String itemName; - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("crucible"); - - @SideOnly(Side.CLIENT) - private IIcon iconHot; - - public Crucible() { - super(); - this.itemName="crucible"; - this.setUnlocalizedName(itemName); - GameRegistry.registerItem(this, this.itemName); - this.setCreativeTab(IHLCreativeTab.tab); - this.maxStackSize=1; - this.setCreativeTab(IHLCreativeTab.tab); - this.setMaxDamage(0); - } - - public static void addRecipe(String string, FluidStack output) - { - recipeManager.addRecipe(new UniversalRecipeInput(null, new IRecipeInput[] {new RecipeInputOreDict(string)}), new UniversalRecipeOutput(new FluidStack[] {output},null,20)); - } - - @Override - public IHasGui getInventory(EntityPlayer entityPlayer, ItemStack itemStack) - { - return new CrucibleInventory(entityPlayer, itemStack); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) - { - if (IC2.platform.isSimulating()) - { - IC2.platform.launchGui(entityPlayer, this.getInventory(entityPlayer, itemStack)); - } - return itemStack; - } - - /** - * allows items to add custom lines of information to the mouseover description - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) - { - super.addInformation(itemStack, player, info, b); - FluidStack fs = this.getFluid(itemStack); - - if (fs != null) - { - info.add("< " + FluidRegistry.getFluidName(fs) + ", " + fs.amount + " mB >"); - } - else - { - info.add(StatCollector.translateToLocal("ic2.item.FluidContainer.Empty")); - } - } - - @Override - public List getHudInfo(ItemStack itemStack) - { - LinkedList info = new LinkedList(); - FluidStack fs = this.getFluid(itemStack); - - if (fs != null) - { - info.add("< " + FluidRegistry.getFluidName(fs) + ", " + fs.amount + " mB >"); - } - else - { - info.add(StatCollector.translateToLocal("ic2.item.FluidContainer.Empty")); - } - - return info; - } - - @Override - public FluidStack getFluid(ItemStack stack) - { - NBTTagCompound nbtTagCompound = StackUtil.getOrCreateNbtData(stack); - NBTTagCompound fluidTag = nbtTagCompound.getCompoundTag("Fluid"); - return FluidStack.loadFluidStackFromNBT(fluidTag); - } - - public boolean isEmpty(ItemStack stack) - { - return this.getFluid(stack) == null; - } - - @Override - public int getCapacity(ItemStack container) - { - return this.capacity; - } - - public boolean canfill(Fluid var1) - { - return true; - } - - public ItemStack processContent(ItemStack itemStack, IInventory inventoryContainer) - { - CrucibleInventory inventory = new CrucibleInventory(inventoryContainer, itemStack); - ItemStack content = inventory.getStackInSlot(0); - if(content!=null) - { - UniversalRecipeOutput routput = recipeManager.getOutputFor(null, Arrays.asList(new ItemStack [] {content})); - if(routput!=null && !routput.getFluidOutputs().isEmpty()) - { - FluidStack fluidStack = routput.getFluidOutputs().get(0).copy(); - fluidStack.amount *= content.stackSize; - itemStack.stackTagCompound = new NBTTagCompound(); - this.fill(itemStack, fluidStack, true); - return itemStack; - } - } - return itemStack; - } - - @Override - public int fill(ItemStack stack, FluidStack resource, boolean doFill) - { - if (stack.stackSize != 1) - { - return 0; - } - else if (resource == null) - { - return 0; - } - else if (!this.canfill(resource.getFluid())) - { - return 0; - } - else - { - NBTTagCompound nbtTagCompound = StackUtil.getOrCreateNbtData(stack); - NBTTagCompound fluidTag = nbtTagCompound.getCompoundTag("Fluid"); - FluidStack fs = FluidStack.loadFluidStackFromNBT(fluidTag); - - if (fs == null) - { - fs = new FluidStack(resource, 0); - } - - if (!fs.isFluidEqual(resource)) - { - return 0; - } - else - { - int amount = Math.min(this.capacity - fs.amount, resource.amount); - - if (doFill && amount > 0) - { - fs.amount += amount; - fs.writeToNBT(fluidTag); - nbtTagCompound.setTag("Fluid", fluidTag); - if(fs.getFluid().getTemperature()>900)stack.setItemDamage(1); - } - - return amount; - } - } - } - - @Override - public FluidStack drain(ItemStack stack, int maxDrain, boolean doDrain) - { - if (stack.stackSize != 1) - { - return null; - } - else - { - NBTTagCompound nbtTagCompound = StackUtil.getOrCreateNbtData(stack); - NBTTagCompound fluidTag = nbtTagCompound.getCompoundTag("Fluid"); - FluidStack fs = FluidStack.loadFluidStackFromNBT(fluidTag); - - if (fs == null) - { - return null; - } - else - { - maxDrain = Math.min(fs.amount, maxDrain); - - if (doDrain) - { - fs.amount -= maxDrain; - - if (fs.amount <= 0) - { - nbtTagCompound.removeTag("Fluid"); - stack.setItemDamage(0); - } - else - { - fs.writeToNBT(fluidTag); - nbtTagCompound.setTag("Fluid", fluidTag); - } - } - - return new FluidStack(fs, maxDrain); - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - itemIcon=register.registerIcon(IHLModInfo.MODID + ":crucible"); - iconHot=register.registerIcon(IHLModInfo.MODID + ":crucibleHot"); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int meta) - { - switch(meta) - { - case 0: - return this.itemIcon; - case 1: - return this.iconHot; - default: - return this.itemIcon; - } - } - - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) - { - if (!IC2.platform.isSimulating()) - { - return false; - } - else if (this.interactWithTank(stack, player, world, x, y, z, side)) - { - return true; - } - return false; - } - - - private boolean interactWithTank(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) - { - if (!IC2.platform.isSimulating()) - { - return false; - } - else - { - TileEntity te = world.getTileEntity(x, y, z); - - if (!(te instanceof IFluidHandler)) - { - return false; - } - else - { - IFluidHandler handler = (IFluidHandler)te; - ForgeDirection dir = ForgeDirection.getOrientation(side); - FluidStack fs = this.getFluid(stack); - int amount; - - if (fs != null && (!player.isSneaking() || fs.amount >= this.capacity)) - { - amount = handler.fill(dir, fs, false); - - if (amount <= 0) - { - return false; - } - else - { - fs = LiquidUtil.drainContainerStack(stack, player, amount, false); - - if (fs != null && fs.amount > 0) - { - handler.fill(dir, fs, true); - return true; - } - else - { - return false; - } - } - } - else - { - amount = fs == null ? this.capacity : this.capacity - fs.amount; - FluidStack input = handler.drain(dir, amount, false); - - if (input != null && input.amount > 0) - { - amount = LiquidUtil.fillContainerStack(stack, player, input, false); - - if (amount <= 0) - { - return false; - } - else - { - handler.drain(dir, amount, true); - return true; - } - } - else - { - return false; - } - } - } - } - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - -} diff --git a/ihl/processing/metallurgy/CrucibleContainer.java b/ihl/processing/metallurgy/CrucibleContainer.java deleted file mode 100644 index 20ec65e..0000000 --- a/ihl/processing/metallurgy/CrucibleContainer.java +++ /dev/null @@ -1,66 +0,0 @@ -package ihl.processing.metallurgy; - -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.util.StackUtil; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class CrucibleContainer extends ContainerBase -{ - public CrucibleInventory box; - public CrucibleContainer(EntityPlayer entityPlayer, CrucibleInventory box) - { - super(box); - this.box = box; - int col; - if(((Crucible)this.box.thisItemStack.getItem()).isEmpty(this.box.thisItemStack)) - { - this.addSlotToContainer(new CrucibleSlot(this.box, 0, 81, 42)); - } - 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, 84 + col * 18)); - } - } - - for (col = 0; col < 9; ++col) - { - this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, 142)); - } - } - - @Override - public ItemStack slotClick(int slot, int button, int par3, EntityPlayer player) - { - if (player instanceof EntityPlayerMP && IC2.platform.isSimulating() && slot == -999 && (button == 0 || button == 1)) - { - ItemStack stack = player.inventory.getItemStack(); - - if (stack != null) - { - StackUtil.getOrCreateNbtData(stack); - - if (this.box.isThisContainer(stack)) - { - ((EntityPlayerMP)player).closeScreen(); - } - } - } - return super.slotClick(slot, button, par3, player); - } - - /** - * Called when the container is closed. - */ - @Override - public void onContainerClosed(EntityPlayer entityPlayer) - { - this.box.onGuiClosed(entityPlayer); - super.onContainerClosed(entityPlayer); - } -} diff --git a/ihl/processing/metallurgy/CrucibleGui.java b/ihl/processing/metallurgy/CrucibleGui.java deleted file mode 100644 index f05e7bb..0000000 --- a/ihl/processing/metallurgy/CrucibleGui.java +++ /dev/null @@ -1,84 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import ic2.core.util.DrawUtil; -import ic2.core.util.GuiTooltipHelper; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -public class CrucibleGui extends GuiContainer -{ - public CrucibleContainer container; - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUICrucible.png"); - private static final String title = StatCollector.translateToLocal("item.crucible.name"); - - public CrucibleGui(CrucibleContainer container1) - { - super(container1); - this.container = container1; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString(title, 68, 0, 6171880); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - @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); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.mc.renderEngine.bindTexture(background); - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if(this.getItemStack().getItemDamage()==1) - { - this.drawTexturedModalRect(x+67, y+26, 198, 52, 58, 39); - } - FluidStack fluidStack = this.getItemInstance().getFluid(this.getItemStack()); - if (fluidStack!=null && fluidStack.amount > 0) - { - Fluid fluid = fluidStack.getFluid(); - if(fluid!=null) - { - IIcon fluidIcon = fluid.getIcon(); - if (fluidIcon != null) - { - this.mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - int liquidHeight = fluidStack.amount*20/getItemInstance().capacity; - DrawUtil.drawRepeated(fluidIcon, x+71, y+ 41 + 20 - liquidHeight, 35.0D, liquidHeight, this.zLevel); - } - } - String tooltip = StatCollector.translateToLocal(fluidStack.getFluid().getName()) + ": " + fluidStack.amount + "mB"; - GuiTooltipHelper.drawAreaTooltip(par2, par3, tooltip, x-16, y+10, x+16, y+29); - } - this.mc.renderEngine.bindTexture(background); - if(this.getItemStack().getItemDamage()==1) - { - this.drawTexturedModalRect(x+68, y+40, 198, 26, 58, 26); - } - else - { - this.drawTexturedModalRect(x+68, y+40, 198, 0, 58, 26); - } - } - - private Crucible getItemInstance() - { - return ((Crucible)this.container.box.thisItemStack.getItem()); - } - - private ItemStack getItemStack() - { - return this.container.box.thisItemStack; - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/CrucibleInventory.java b/ihl/processing/metallurgy/CrucibleInventory.java deleted file mode 100644 index 253483f..0000000 --- a/ihl/processing/metallurgy/CrucibleInventory.java +++ /dev/null @@ -1,126 +0,0 @@ -package ihl.processing.metallurgy; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.item.tool.HandHeldInventory; -import ic2.core.util.StackUtil; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -public class CrucibleInventory extends HandHeldInventory { - - ItemStack thisItemStack; - IInventory inventoryContainer; - - public CrucibleInventory(EntityPlayer player, ItemStack stack) { - super(player, stack, 1); - thisItemStack = stack; - inventoryContainer = player.inventory; - } - - public CrucibleInventory(IInventory inventoryContainer1, ItemStack stack) { - super(null, stack, 1); - thisItemStack = stack; - inventoryContainer = inventoryContainer1; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new CrucibleGui(new CrucibleContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new CrucibleContainer(player, this); - } - - @Override - public String getInventoryName() { - return "crucible"; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public boolean isItemValidForSlot(int arg0, ItemStack stack) { - return true; - } - - @Override - public int getInventoryStackLimit() { - return 6; - } - - @Override - public void save() { - if (IC2.platform.isSimulating()) { - NBTTagCompound nbtTagCompound = StackUtil.getOrCreateNbtData(this.thisItemStack); - - for (int nbtTagList = 0; nbtTagList < this.getSizeInventory(); ++nbtTagList) { - if (this.inventory[nbtTagList] != null) { - NBTTagCompound i = StackUtil.getOrCreateNbtData(this.inventory[nbtTagList]); - - if (nbtTagCompound.getInteger("uid") == i.getInteger("uid")) { - this.thisItemStack.stackSize = 1; - this.inventory[nbtTagList] = null; - break; - } - } - } - - NBTTagList var7 = new NBTTagList(); - int var8; - - for (var8 = 0; var8 < this.inventory.length; ++var8) { - if (this.inventory[var8] != null) { - NBTTagCompound itemStackSlot = new NBTTagCompound(); - itemStackSlot.setByte("Slot", (byte) var8); - this.inventory[var8].writeToNBT(itemStackSlot); - var7.appendTag(itemStackSlot); - } - } - - nbtTagCompound.setTag("Items", var7); - - for (var8 = -1; var8 < inventoryContainer.getSizeInventory(); ++var8) { - ItemStack var9 = null; - - if (var8 == -1 && inventoryContainer instanceof InventoryPlayer) { - var9 = ((InventoryPlayer) inventoryContainer).getItemStack(); - } else if (var8 >= 0) { - var9 = inventoryContainer.getStackInSlot(var8); - } - - if (var9 != null) { - NBTTagCompound nbtTagCompoundSlot = var9.getTagCompound(); - - if (nbtTagCompoundSlot != null - && nbtTagCompound.getInteger("uid") == nbtTagCompoundSlot.getInteger("uid")) { - this.thisItemStack.stackSize = 1; - - if (var8 == -1 && inventoryContainer instanceof InventoryPlayer) { - ((InventoryPlayer) inventoryContainer).setItemStack(this.thisItemStack); - } else { - inventoryContainer.setInventorySlotContents(var8, this.thisItemStack); - } - - break; - } - } - } - - } - } - -} diff --git a/ihl/processing/metallurgy/CrucibleSlot.java b/ihl/processing/metallurgy/CrucibleSlot.java deleted file mode 100644 index 5fc6a33..0000000 --- a/ihl/processing/metallurgy/CrucibleSlot.java +++ /dev/null @@ -1,18 +0,0 @@ -package ihl.processing.metallurgy; - -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class CrucibleSlot extends Slot { - CrucibleInventory inventory; - - public CrucibleSlot(CrucibleInventory arg0, int arg1, int arg2, int arg3) { - super(arg0, arg1, arg2, arg3); - inventory = arg0; - } - - @Override - public boolean isItemValid(ItemStack itemstack) { - return itemstack != null; - } -} diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java b/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java deleted file mode 100644 index 94d479c..0000000 --- a/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java +++ /dev/null @@ -1,39 +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.Slot; - -public class DetonationSprayingMachineContainer extends ContainerBase { - - protected DetonationSprayingMachineTileEntity tileEntity; - public int lastFluidAmount = -1; - public short lastProgress = -1; - private final static int height=166; - - public DetonationSprayingMachineContainer(EntityPlayer entityPlayer, DetonationSprayingMachineTileEntity detonationSprayingMachineTileEntity){ - super(detonationSprayingMachineTileEntity); - this.tileEntity = detonationSprayingMachineTileEntity; - 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(detonationSprayingMachineTileEntity.input, 0, 10, 17)); - this.addSlotToContainer(new SlotInvSlot(detonationSprayingMachineTileEntity.input, 1, 98, 17)); - this.addSlotToContainer(new SlotInvSlot(detonationSprayingMachineTileEntity.input, 2, 117, 17)); - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineGui.java b/ihl/processing/metallurgy/DetonationSprayingMachineGui.java deleted file mode 100644 index 8cd29d0..0000000 --- a/ihl/processing/metallurgy/DetonationSprayingMachineGui.java +++ /dev/null @@ -1,48 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.Iterator; - -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -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; - -@SideOnly(Side.CLIENT) -public class DetonationSprayingMachineGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIDetonationSprayingMachine.png"); - 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); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); - } - - @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 - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - Iterator noteListIterator = this.mc.fontRenderer.listFormattedStringToWidth(hint, 140).iterator(); - int yTextPos=40; - while(noteListIterator.hasNext()) - { - GuiDraw.fontRenderer.drawStringWithShadow(noteListIterator.next(), x+15, y+yTextPos, 16777215); - yTextPos+=10; - } - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineModel.java b/ihl/processing/metallurgy/DetonationSprayingMachineModel.java deleted file mode 100644 index 7335125..0000000 --- a/ihl/processing/metallurgy/DetonationSprayingMachineModel.java +++ /dev/null @@ -1,57 +0,0 @@ -package ihl.processing.metallurgy; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraftforge.common.util.ForgeDirection; - -public class DetonationSprayingMachineModel extends ModelBase { - //fields - IHLModelRenderer Base; - - public DetonationSprayingMachineModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape1", 20, 0); - setTextureOffset("Base.Shape2", 34, 0); - setTextureOffset("Base.Shape3", 23, 0); - setTextureOffset("Base.Shape4", 23, 0); - setTextureOffset("Base.Shape5", 0, 0); - setTextureOffset("Base.Tube1", 0, 0); - setTextureOffset("Base.Tube2", 0, 0); - setTextureOffset("Base.Shape12", 0, 20); - setTextureOffset("Base.Shape13", 0, 20); - setTextureOffset("Base.Shape14", 0, 20); - setTextureOffset("Base.Shape7", 26, 22); - setTextureOffset("Base.Shape8", 18, 19); - setTextureOffset("Base.Shape9", 18, 22); - setTextureOffset("Base.Tube11", 8, 5); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 8F, 0F); - Base.mirror = true; - Base.addBox("Shape1", 4F, 6F, 7F, 2, 9, 1, false); - Base.addBox("Shape2", -7F, 4F, 6F, 14, 11, 1, false); - Base.addBox("Shape3", -1F, 6F, 7F, 2, 9, 1, false); - Base.addBox("Shape4", -6F, 6F, 7F, 2, 9, 1, false); - Base.addBox("Shape5", -8F, 15F, -8F, 16, 1, 16, false); - Base.addTube("Tube1", -1F, 10F, -7F, 2, 2, 6, 0.5F,1F,ForgeDirection.NORTH); - Base.addTube("Tube2", -2.5F, 10.5F, -6F, 5, 1, 1, 0F,1F,ForgeDirection.EAST); - Base.addBox("Shape12", -2.5F, 11.7F, -2.2F, 5, 4, 1, false); - Base.addBox("Shape13", 1F, 9F, -8F, 1, 6, 6, false); - Base.addBox("Shape14", -2F, 9F, -8F, 1, 6, 6, false); - Base.addBox("Shape7", -1F, 14F, -8F, 2, 1, 5, false); - Base.addBox("Shape8", 2F, 14F, -8F, 2, 1, 9, false); - Base.addBox("Shape9", -4F, 14F, -8F, 2, 1, 9, false); - Base.addTube("Tube11", -1F, 10F, -8F, 2, 2, 1, 0F,1F,ForgeDirection.NORTH); - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } -} - - diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineRender.java b/ihl/processing/metallurgy/DetonationSprayingMachineRender.java deleted file mode 100644 index b68f8b3..0000000 --- a/ihl/processing/metallurgy/DetonationSprayingMachineRender.java +++ /dev/null @@ -1,61 +0,0 @@ -package ihl.processing.metallurgy; -import org.lwjgl.opengl.GL11; - -import ic2.api.tile.IWrenchable; -import ihl.IHLModInfo; -import ihl.utils.IHLItemRenderer; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -public class DetonationSprayingMachineRender extends TileEntitySpecialRenderer{ -private DetonationSprayingMachineModel model = new DetonationSprayingMachineModel(); -private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/detonationSprayingMachine.png"); -private final float scale=1F/16F; -private IHLItemRenderer itemRenderer=new IHLItemRenderer(true); - -public DetonationSprayingMachineRender(){} - -public void renderAModelAt(DetonationSprayingMachineTileEntity tile, double x, double y, double z, float f) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y+0.5F, (float)z + 0.5F); - int rotation = 0; - if(tile.getWorldObj() != null) - { - switch (((IWrenchable)tile).getFacing()) - { - case 2: - rotation = 0; - break; - case 5: - rotation = 1; - break; - case 3: - rotation = 2; - break; - case 4: - rotation = 3; - break; - default: - rotation = 0; - } - } - GL11.glRotatef(-rotation*90f, 0F, 1F, 0F); - if(tile.input.get()!=null) - { - this.itemRenderer.doRender(RenderManager.instance,tile.input.get(),0F,-0.2F,-0.35F); - } - bindTexture(tex); //texture - GL11.glScalef(1F, -1F, -1F); - GL11.glTranslatef(0F, -1.0F, 0F); - model.Base.render(scale); - GL11.glPopMatrix(); -} - - @Override - public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) - { - this.renderAModelAt((DetonationSprayingMachineTileEntity)par1TileEntity, par2, par4, par6, par8); - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java b/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java deleted file mode 100644 index 411b8db..0000000 --- a/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java +++ /dev/null @@ -1,198 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.network.INetworkTileEntityEventListener; -import ic2.api.recipe.IRecipeInput; -import ic2.api.recipe.RecipeInputItemStack; -import ic2.api.recipe.RecipeInputOreDict; -import ic2.core.ContainerBase; -import ic2.core.ExplosionIC2; -import ic2.core.IC2; -import ic2.core.IHasGui; -import ic2.core.audio.AudioSource; -import ic2.core.audio.PositionSpec; -import ic2.core.block.TileEntityInventory; -import ic2.core.block.invslot.InvSlot.Access; -import ihl.processing.chemistry.ApparatusProcessableInvSlot; -import ihl.recipes.RecipeOutputItemStack; -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 net.minecraft.nbt.NBTTagCompound; - -public class DetonationSprayingMachineTileEntity extends TileEntityInventory implements IHasGui, INetworkTileEntityEventListener -{ - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("detonationsprayingmachine"); - public final ApparatusProcessableInvSlot input; - private AudioSource explosion; - - public DetonationSprayingMachineTileEntity() { - super(); - this.input = new ApparatusProcessableInvSlot(this, "input", 0, Access.IO, 3, 64); - } - - @Override - public List getNetworkedFields() - { - List fields = super.getNetworkedFields(); - return fields; - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return false; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("cannonBronze"); - } - - @Override - public String getInventoryName() { - return "detonationSprayingMachine"; - } - - @Override - public void onNetworkEvent(int event) - { - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.explode", 4.0F, 1.0F); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new DetonationSprayingMachineGui(new DetonationSprayingMachineContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new DetonationSprayingMachineContainer(player, this); - } - - @Override - public void onGuiClosed(EntityPlayer player) {} - - public boolean canOperate() - { - return getOutput()!=null; - } - - public UniversalRecipeOutput getOutput() - { - return DetonationSprayingMachineTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - public List[] getInput() - { - return new List[] {null,this.input.getItemStackList()}; - } - - @Override - public void onLoaded() - { - super.onLoaded(); - if (IC2.platform.isRendering() && this.explosion==null) - { - this.explosion = IC2.audioManager.createSource(this, PositionSpec.Center, "Machines/MinerOp.ogg",false,false, 0.5F); - } - } - - - public void operate() - {//diamond file max durability - 128000 - //file tags - "GT.ToolStats"->"MaxDamage" & "Damage" - if(this.canOperate()) - { - List input1 = DetonationSprayingMachineTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); - List output1 = DetonationSprayingMachineTileEntity.recipeManager.getOutputFor(getInput()).getItemOutputs(); - ItemStack resultStack = output1.get(0).itemStack.copy(); - resultStack.stackSize=this.input.get(0).stackSize; - if(resultStack.stackTagCompound==null) - { - resultStack.stackTagCompound=this.input.get(0).stackTagCompound; - } - if(resultStack.stackTagCompound!=null && resultStack.stackTagCompound.hasKey("GT.ToolStats")) - { - NBTTagCompound gtTagCompound = resultStack.stackTagCompound.getCompoundTag("GT.ToolStats"); - if(gtTagCompound!=null && gtTagCompound.hasKey("MaxDamage")) - { - int maxDamage = gtTagCompound.getInteger("MaxDamage"); - int damage = 0; - if(gtTagCompound.hasKey("Damage")) - { - damage = gtTagCompound.getInteger("Damage"); - } - if(damage getRecipes() { - return recipeManager.getRecipes(); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/ElectricEngineItem.java b/ihl/processing/metallurgy/ElectricEngineItem.java deleted file mode 100644 index c1e0003..0000000 --- a/ihl/processing/metallurgy/ElectricEngineItem.java +++ /dev/null @@ -1,84 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.IHLCreativeTab; -import ihl.IHLModInfo; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; -import net.minecraft.util.IIcon; - -public class ElectricEngineItem extends Item{ - - public Type type; - public static List instances = new ArrayList (); - private static Map iconMap = new HashMap(); - - - public ElectricEngineItem(Type type1) - { - super(); - this.type=type1; - this.setCreativeTab(IHLCreativeTab.tab); - this.setUnlocalizedName(type.unLocalizedName); - this.setMaxStackSize(1); - instances.add(this); - } - - public static void init() - { - Type[] var1 = Type.values(); - for(int i=0;i ii = instances.iterator(); - while(ii.hasNext()) - { - ElectricEngineItem instance = ii.next(); - GameRegistry.registerItem(instance,instance.type.unLocalizedName); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - iconMap.put(this.type, register.registerIcon(IHLModInfo.MODID + ":"+this.type.unLocalizedName)); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int i) - { - return iconMap.get(type); - } - - - public enum Type - { - LVLEElectricEngine("electricMotorLVLEDC", 600,400,0.2F,1500); - Type(String unlocalizedName1, int maxVoltage1, int generatedVoltage1, float efficiency1,int rpm1) - { - unLocalizedName=unlocalizedName1; - maxVoltage=maxVoltage1; - generatedVoltage=generatedVoltage1; - efficiency=efficiency1; - rpm=rpm1; - } - - public String unLocalizedName; - public int maxVoltage=600; - public int generatedVoltage=400; - public float efficiency = 0.2F; - public int rpm=1500;//at max voltage - } - -} diff --git a/ihl/processing/metallurgy/ExtruderContainer.java b/ihl/processing/metallurgy/ExtruderContainer.java deleted file mode 100644 index 77b92e6..0000000 --- a/ihl/processing/metallurgy/ExtruderContainer.java +++ /dev/null @@ -1,75 +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 ExtruderContainer extends ContainerBase { - - public ExtruderTileEntity tileEntity; - public int lastProgress = -1; - private short lastEnergy = -1; - private final static int height=166; - - public ExtruderContainer(EntityPlayer entityPlayer, - ExtruderTileEntity lathePart1TileEntity) { - super(lathePart1TileEntity); - tileEntity=lathePart1TileEntity; - 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(lathePart1TileEntity.input, 0, 39, 32)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input2, 0, 57, 32)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 8, 32)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - if (this.tileEntity.getEnergy() != this.lastEnergy) - { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); - } - } - this.lastProgress = this.tileEntity.progress; - this.lastEnergy = (short) this.tileEntity.getEnergy(); - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - case 1: - this.tileEntity.setEnergy(value); - break; - } - } - -} diff --git a/ihl/processing/metallurgy/ExtruderGui.java b/ihl/processing/metallurgy/ExtruderGui.java deleted file mode 100644 index acf1a76..0000000 --- a/ihl/processing/metallurgy/ExtruderGui.java +++ /dev/null @@ -1,49 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -public class ExtruderGui extends GuiContainer { - - private ExtruderContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIExtruder.png"); - - public ExtruderGui(ExtruderContainer latheContainer) { - super(latheContainer); - container = latheContainer; - } - - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(tex); - int i1; - if (this.container.tileEntity.getEnergy() > 0D) - { - 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.9F); - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(9, 15 + 12 - i1, 176, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) - { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); - this.drawTexturedModalRect(74, 34, 198, 0, i1 + 1, 13); - } - } - - @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); - } -} diff --git a/ihl/processing/metallurgy/ExtruderModel.java b/ihl/processing/metallurgy/ExtruderModel.java deleted file mode 100644 index fcff405..0000000 --- a/ihl/processing/metallurgy/ExtruderModel.java +++ /dev/null @@ -1,100 +0,0 @@ -package ihl.processing.metallurgy; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class ExtruderModel extends ModelBase -{ - //fields - IHLModelRenderer Base; - IHLModelRenderer RotatingPart2; - IHLModelRenderer MotorPart1; - IHLModelRenderer MotorPart2; - IHLModelRenderer Belt; - IHLModelRenderer Belt2; - IHLModelRenderer Extruder; - - public ExtruderModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 0); - setTextureOffset("Base.Shape3", 0, 0); - setTextureOffset("Base.Shape16", 0, 0); - setTextureOffset("RotatingPart2.PipeN7", 49, 23); - setTextureOffset("RotatingPart2.PipeN4", 0, 7); - setTextureOffset("MotorPart1.PipeN41", 0, 0); - setTextureOffset("MotorPart1.PipeN12", 0, 0); - setTextureOffset("MotorPart1.PipeN13", 0, 0); - setTextureOffset("MotorPart2.Shape4", 0, 24); - setTextureOffset("MotorPart2.Shape7", 0, 9); - setTextureOffset("MotorPart2.Shape10", 0, 9); - setTextureOffset("Belt.Shape12", 0, 0); - setTextureOffset("Belt2.Shape13", 0, 0); - setTextureOffset("Extruder.PipeN16", 0, 0); - setTextureOffset("Extruder.PipeN15", 24, 20); - setTextureOffset("Extruder.Shape8", 0, 0); - setTextureOffset("Extruder.PipeU17", 0, 0); - setTextureOffset("Extruder.PipeUC18", 0, 0); - setTextureOffset("Extruder.Shape14", 0, 0); - setTextureOffset("Extruder.PipeN14", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); - Base.addBox("Shape3", -5F, 0F, -7F, 4, 7, 1); - Base.addBox("Shape16", 3F, 3F, -6F, 3, 4, 1); - RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); - RotatingPart2.setRotationPoint(-3F, 18F, -7F); - setRotation(RotatingPart2, 0F, 0F, 0F); - RotatingPart2.mirror = true; - RotatingPart2.addTube("PipeN7", -2.5F, -2.5F, -1F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN4", -1F, -1F, 1F, 2, 2, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); - MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); - setRotation(MotorPart1, 0F, 0F, 0F); - MotorPart1.mirror = true; - MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); - MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); - MotorPart2.setRotationPoint(0F, 16F, 0F); - setRotation(MotorPart2, 0F, 0F, 0F); - MotorPart2.mirror = true; - MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); - MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); - MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); - Belt = new IHLModelRenderer(this, "Belt"); - Belt.setRotationPoint(-3F, 15.5F, -7.9F); - setRotation(Belt, 0F, 0F, 0.45F); - Belt.mirror = true; - Belt.addBox("Shape12", 0.5F, 0F, 0F, 8, 1, 1); - Belt2 = new IHLModelRenderer(this, "Belt2"); - Belt2.setRotationPoint(-3F, 19.5F, -7.9F); - setRotation(Belt2, 0F, 0F, 0.19F); - Belt2.mirror = true; - Belt2.addBox("Shape13", 0F, 0F, 0F, 8, 1, 1); - Extruder = new IHLModelRenderer(this, "Extruder"); - Extruder.setRotationPoint(0F, 16F, 0F); - setRotation(Extruder, 0F, 0F, 0F); - Extruder.mirror = true; - Extruder.addTube("PipeN16", -4.5F, 0.5F, -5F, 3, 3, 12, 0F,1F,ForgeDirection.NORTH); - Extruder.addTube("PipeN15", -5.5F, -0.5F, 0F, 5, 5, 7, 0.5F,1F,ForgeDirection.NORTH); - Extruder.addBox("Shape8", -5F, 4F, 6.9F, 4, 3, 1); - Extruder.addTube("PipeU17", -5.5F, -8F, -5F, 5, 8, 5, 0.8F,1F,ForgeDirection.UP); - Extruder.addTube("PipeUC18", -5.5F, 0F, -5F, 5, 2, 5, 0.8F,0.6F,ForgeDirection.UP); - Extruder.addBox("Shape14", -5F, 3F, -4.9F, 4, 4, 1); - Extruder.addTube("PipeN14", -5.5F, -0.5F, 7F, 5, 5, 1, 0.5F,1F,ForgeDirection.NORTH); - } - - 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/ExtruderTileEntity.java b/ihl/processing/metallurgy/ExtruderTileEntity.java deleted file mode 100644 index a46ae62..0000000 --- a/ihl/processing/metallurgy/ExtruderTileEntity.java +++ /dev/null @@ -1,155 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ic2.core.block.invslot.InvSlot.Access; -import ihl.processing.chemistry.ApparatusProcessableInvSlot; -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 net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.IFluidHandler; - -public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ - - public final ApparatusProcessableInvSlot input; - public final ApparatusProcessableInvSlot input2; - private int processTimer=0; - private FluidTank fluidTank = new FluidTank(1000); - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("extruder"); - - public ExtruderTileEntity() - { - super(); - input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64); - input2 = new ApparatusProcessableInvSlot(this, "input2", 2, Access.IO, 1, 64); - } - - - - @Override - public List getNetworkedFields() - { - return super.getNetworkedFields(); - } - - - @Override - public String getInventoryName() { - return "Extruder"; - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - 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) - { - this.processTimer=0; - ((IFluidHandler)te).fill(ForgeDirection.getOrientation(getFacing()), this.fluidTank.drain(this.fluidTank.getCapacity(), true), true); - } - - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("extruder"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new ExtruderGui(new ExtruderContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new ExtruderContainer(player, this); - } - - @Override - public void operate() - { - UniversalRecipeInput ri = ExtruderTileEntity.recipeManager.getRecipeInput(getInput()); - this.fluidTank.fill(getOutput().getFluidOutputs().get(0), true); - this.input.consume(ri.getItemInputs().get(0)); - this.input2.consume(ri.getItemInputs().get(1)); - } - - public UniversalRecipeOutput getOutput() - { - return ExtruderTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public List[] getInput() - { - return new List[]{null,Arrays.asList(new ItemStack[] {input.get(),input2.get()})}; - } - - @Override - public boolean canOperate() - { - return this.fluidTank.getFluidAmount() getRecipes() { - return recipeManager.getRecipes(); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - -} diff --git a/ihl/processing/metallurgy/GasWeldingStationContainer.java b/ihl/processing/metallurgy/GasWeldingStationContainer.java deleted file mode 100644 index e960edb..0000000 --- a/ihl/processing/metallurgy/GasWeldingStationContainer.java +++ /dev/null @@ -1,99 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; - -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraftforge.fluids.FluidStack; - -public class GasWeldingStationContainer extends ContainerBase { - - protected GasWeldingStationTileEntity tileEntity; - public short lastProgress2 = -1; - private final static int height=166; - public int lastFluidAmount = -1; - public int lastNumberOfFluids = -1; - public int lastFluidAmount2 = -1; - public int lastNumberOfFluids2 = -1; - public List fluidTankFluidList; - public List fluidTankFluidList2; - - public GasWeldingStationContainer(EntityPlayer entityPlayer, GasWeldingStationTileEntity weldingStation){ - super(weldingStation); - this.tileEntity = weldingStation; - fluidTankFluidList = this.tileEntity.flammableGasTank.getFluidList(); - fluidTankFluidList2 = this.tileEntity.oxygenTank.getFluidList(); - 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(tileEntity.drainInputSlotOxygen, 0, 8, 15)); - this.addSlotToContainer(new SlotInvSlot(tileEntity.drainInputSlotFlammableGas, 0, 44, 15)); - this.addSlotToContainer(new SlotInvSlot(tileEntity.fillInputSlotOxygen, 0, 8, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity.fillInputSlotFlammableGas, 0, 44, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity.emptyFluidItemsSlot, 0, 8, 33)); - this.addSlotToContainer(new SlotInvSlot(tileEntity.emptyFluidItemsSlot, 1, 44, 33)); - this.addSlotToContainer(new SlotInvSlot(tileEntity.input, 0, 62, 51)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - if (this.tileEntity.progress2 != this.lastProgress2) - { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.progress2); - } - if (this.tileEntity.flammableGasTank.getFluidAmount() != this.lastFluidAmount || this.tileEntity.flammableGasTank.getNumberOfFluids() != this.lastNumberOfFluids) - { - - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - - if (this.tileEntity.oxygenTank.getFluidAmount() != this.lastFluidAmount2 || this.tileEntity.oxygenTank.getNumberOfFluids() != this.lastNumberOfFluids2) - { - - IC2.network.get().sendContainerField(this, "fluidTankFluidList2"); - } - } - - - this.lastProgress2 = this.tileEntity.progress2; - this.lastNumberOfFluids = this.tileEntity.flammableGasTank.getNumberOfFluids(); - this.lastFluidAmount = this.tileEntity.flammableGasTank.getFluidAmount(); - this.lastNumberOfFluids2 = this.tileEntity.oxygenTank.getNumberOfFluids(); - this.lastFluidAmount2 = this.tileEntity.oxygenTank.getFluidAmount(); - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - switch (index) - { - case 1: - this.tileEntity.progress2=(short) value; - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/metallurgy/GasWeldingStationGui.java b/ihl/processing/metallurgy/GasWeldingStationGui.java deleted file mode 100644 index 79becd5..0000000 --- a/ihl/processing/metallurgy/GasWeldingStationGui.java +++ /dev/null @@ -1,78 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.IC2; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Slot; -import net.minecraft.util.ResourceLocation; - -@SideOnly(Side.CLIENT) -public class GasWeldingStationGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIGasWeldingStation.png"); - private GasWeldingStationContainer container; - private int outputslotoffset=45; - - public GasWeldingStationGui (GasWeldingStationContainer 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); - int i1; - if (this.container.tileEntity.progress2 > 0) - { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); - this.drawTexturedModalRect(90, 30, getFrameX(i1), getFrameY(i1),24,24); - } - if (this.container.tileEntity.flammableGasTank.getFluid()!=null && this.container.tileEntity.flammableGasTank.getFluidAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.flammableGasTank, 64, 28, 76, 67, zLevel, par1, par2, xOffset, yOffset); - } - if (this.container.tileEntity.oxygenTank.getFluid()!=null && this.container.tileEntity.oxygenTank.getFluidAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.oxygenTank, 28, 28, 40, 67, zLevel, par1, par2, xOffset, yOffset); - } - - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - @Override - public void handleMouseClick(Slot slot,int arg1,int arg2,int arg3) - { - if(slot!=null && slot.slotNumber>=outputslotoffset && slot.slotNumber getNetworkedFields() - { - List fields = super.getNetworkedFields(); - return fields; - } - - @Override - public void updateEntityServer() - { - if (this.canProduceGas()) - { - ++this.progress2; - if (this.progress2 >= this.operationLength) - { - this.produceGas(); - this.progress2 = 0; - } - } - else - { - if (!this.canProduceGas()) - { - this.progress2 = 0; - } - } - IHLUtils.handleFluidSlotsBehaviour(fillInputSlotFlammableGas, drainInputSlotFlammableGas, emptyFluidItemsSlot, flammableGasTank); - IHLUtils.handleFluidSlotsBehaviour(fillInputSlotOxygen, drainInputSlotOxygen, emptyFluidItemsSlot, oxygenTank); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - this.flammableGasTank.readFromNBT(nbttagcompound.getCompoundTag("flammableGasTank")); - this.oxygenTank.readFromNBT(nbttagcompound.getCompoundTag("oxygenTank")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - NBTTagCompound flammableGasTankNBT = new NBTTagCompound(); - this.flammableGasTank.writeToNBT(flammableGasTankNBT); - nbttagcompound.setTag("flammableGasTank", flammableGasTankNBT); - NBTTagCompound oxygenTankNBT = new NBTTagCompound(); - this.oxygenTank.writeToNBT(oxygenTankNBT); - nbttagcompound.setTag("oxygenTank", oxygenTankNBT); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return false; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("gasWeldingStation"); - } - - @Override - public String getInventoryName() { - return "detonationSprayingMachine"; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new GasWeldingStationGui(new GasWeldingStationContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new GasWeldingStationContainer(player, this); - } - - @Override - public void onGuiClosed(EntityPlayer player) {} - - @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - } - - public boolean canProduceGas() - { - UniversalRecipeOutput rOutput = GasWeldingStationTileEntity.acetyleneRecipeManager.getOutputFor(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()})); - return rOutput!=null; - } - - public void produceGas() - { - if(canProduceGas()) - { - UniversalRecipeInput rInput = GasWeldingStationTileEntity.acetyleneRecipeManager.getRecipeInput(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()})); - UniversalRecipeOutput rOutput = GasWeldingStationTileEntity.acetyleneRecipeManager.getOutputFor(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()})); - FluidStack output1 = rOutput.getFluidOutputs().get(0).copy(); - FluidStack output2 = rOutput.getFluidOutputs().get(1).copy(); - this.flammableGasTank.drain(rInput.getFluidInputs().get(0), true); - this.input.get().stackSize-=rInput.getItemInputs().get(0).getAmount(); - if(this.input.get().stackSize<=0) - { - this.input.clear(); - } - this.flammableGasTank.fill(output1, true); - this.flammableGasTank.fill(output2, true); - } - } - - - public UniversalRecipeInput getInput() - { - 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(new FluidStack[] {inputFluid},new ItemStack[] {input}), new UniversalRecipeOutput(new FluidStack [] {output, output2},new ItemStack [] {}, 20)); - } - - public static Map getGasRecipes() { - return acetyleneRecipeManager.getRecipes(); - } - - @Override - public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) - { - FluidStack fstack = this.flammableGasTank.drain(amount, doDrain); - return fstack; - } - - @Override - public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { - if(this.flammableGasTank.getFluid().containsFluid(fluidStack)) - { - return this.flammableGasTank.drain(fluidStack.amount, doDrain); - } - return null; - } - - @Override - public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return this.oxygenTank.fill(arg1, arg2); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { - return new FluidTankInfo[] {this.flammableGasTank.getInfo(),this.oxygenTank.getInfo()}; - } - - - //1.7.10 API - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return true; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return true; - } - - public int gaugeProgressScaled(int i) - { - return this.progress2 * i / this.operationLength; - } - - public int gaugeFlammableGasScaled(int i) - { - if(this.flammableGasTank.getFluid()!=null) - { - return this.flammableGasTank.getFluidAmount() * i /this.flammableGasTank.getCapacity(); - } - else - { - return 0; - } - } - - public int gaugeOxygenScaled(int i) - { - if(this.oxygenTank.getFluid()!=null) - { - return this.oxygenTank.getFluidAmount() * i /this.oxygenTank.getCapacity(); - } - else - { - return 0; - } - } - - @Override - public boolean canBeUsed() - { - return - this.flammableGasTank.getFluid()!=null && - this.flammableGasTank.getLigthestFluid().getFluid().getName().equals("acetylene") && - this.flammableGasTank.getLigthestFluid().amount>=20 && - this.oxygenTank.getFluid()!=null && - this.oxygenTank.getLigthestFluid().getFluid().getName().equals("oxygen") && - this.oxygenTank.getLigthestFluid().amount>=20; - } - - @Override - public void use() - { - this.flammableGasTank.drain(IHLUtils.getFluidStackWithSize("acetylene", 20), true); - this.oxygenTank.drain(IHLUtils.getFluidStackWithSize("oxygen", 20), true); - } - - @Override - public boolean getIsInvalid() - { - return this.isInvalid(); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/IProductionLine.java b/ihl/processing/metallurgy/IProductionLine.java deleted file mode 100644 index 5cf7605..0000000 --- a/ihl/processing/metallurgy/IProductionLine.java +++ /dev/null @@ -1,12 +0,0 @@ -package ihl.processing.metallurgy; - -import net.minecraft.item.ItemStack; - -public interface IProductionLine -{ - - short getFacing(); - boolean canProcess(ItemStack stack); - void process(ItemStack stack); - -} diff --git a/ihl/processing/metallurgy/ImpregnatingMachineContainer.java b/ihl/processing/metallurgy/ImpregnatingMachineContainer.java deleted file mode 100644 index 2a95dcb..0000000 --- a/ihl/processing/metallurgy/ImpregnatingMachineContainer.java +++ /dev/null @@ -1,114 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; - -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraftforge.fluids.FluidStack; - -public class ImpregnatingMachineContainer extends ContainerBase { - - protected ImpregnatingMachineTileEntity tileEntity; - public int lastFluidAmount = -1; - public int lastNumberOfFluids = -1; - public int lastVisibleFluidID = -1; - public int lastVisibleFluidAmount = -1; - public short lastProgress = -1; - public short lastTemperature = -1; - private final static int height=166; - public List fluidTankFluidList; - - public ImpregnatingMachineContainer(EntityPlayer entityPlayer, ImpregnatingMachineTileEntity tileEntity1){ - super(tileEntity1); - this.tileEntity = tileEntity1; - fluidTankFluidList = this.tileEntity.getFluidTank().getFluidList(); - 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.drainInputSlot, 0, 24, 16)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 24, 34)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 24, 52)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 116, 16)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 116, 41)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 116, 59)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - - if (this.tileEntity.getTankAmount() != this.lastFluidAmount || this.tileEntity.getNumberOfFluidsInTank() != this.lastNumberOfFluids) - { - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - - if (this.tileEntity.temperature != this.lastTemperature) - { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.temperature); - } - if (this.tileEntity.visibleFluidId != this.lastVisibleFluidID) - { - icrafting.sendProgressBarUpdate(this, 2, this.tileEntity.visibleFluidId); - } - if (this.tileEntity.visibleFluidAmount != this.lastVisibleFluidAmount) - { - icrafting.sendProgressBarUpdate(this, 3, this.tileEntity.visibleFluidAmount); - } - } - - this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); - this.lastFluidAmount = this.tileEntity.getTankAmount(); - this.lastProgress = this.tileEntity.progress; - this.lastTemperature = this.tileEntity.temperature; - this.lastVisibleFluidID=this.tileEntity.visibleFluidId; - this.lastVisibleFluidAmount=this.tileEntity.visibleFluidAmount; - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - case 1: - this.tileEntity.temperature=(short) value; - break; - case 2: - this.tileEntity.visibleFluidId=value; - break; - case 3: - this.tileEntity.visibleFluidAmount=value; - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/metallurgy/ImpregnatingMachineGui.java b/ihl/processing/metallurgy/ImpregnatingMachineGui.java deleted file mode 100644 index 29ba298..0000000 --- a/ihl/processing/metallurgy/ImpregnatingMachineGui.java +++ /dev/null @@ -1,63 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -@SideOnly(Side.CLIENT) -public class ImpregnatingMachineGui extends GuiContainer { - private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUITubBronze.png"); - private ImpregnatingMachineContainer container; - - - public ImpregnatingMachineGui (ImpregnatingMachineContainer container1) { - //the container is instanciated and passed to the superclass for handling - super(container1); - this.container=container1; - } - - @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, 0.5F); - this.mc.renderEngine.bindTexture(background); - 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); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); - this.drawTexturedModalRect(138, 28, getFrameX(i1), getFrameY(i1),24,24); - } - if (this.container.tileEntity.getTankAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 50, 11, 107, 72, zLevel, par1, par2, xOffset, yOffset); - } - } - - @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(background); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - private int getFrameY(int number) - { - return (number % 10) * 24 + 14; - } - - private int getFrameX(int number) - { - return (number / 10) * 24 + 176; - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/ImpregnatingMachineRender.java b/ihl/processing/metallurgy/ImpregnatingMachineRender.java deleted file mode 100644 index 9529186..0000000 --- a/ihl/processing/metallurgy/ImpregnatingMachineRender.java +++ /dev/null @@ -1,55 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import ihl.interfaces.IFluidTankVisual; -import ihl.model.FluidRenderer; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class ImpregnatingMachineRender extends TileEntitySpecialRenderer { - - private float cap; - - public ImpregnatingMachineRender(float capIn) { - cap = capIn; - } - - public void renderAModelAt(IFluidTankVisual tile, double x, double y, double z, float f) { - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); - float rotation = 0F; - GL11.glRotatef(-rotation, 0F, 1F, 0F); - GL11.glScalef(1F, -1F, -1F); - GL11.glTranslatef(0F, -1.0F, 0F); - GL11.glPopMatrix(); - if (tile.getVisibleFluidId() == -1 || tile.getVisibleFluidAmount() <= 0) { - return; - } - FluidStack fluidStack = new FluidStack(FluidRegistry.getFluid(tile.getVisibleFluidId()), - tile.getVisibleFluidAmount()); - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glTranslatef((float) x, (float) y + 0.1F, (float) z); - GL11.glScalef(0.99F, 0.8F * tile.getRenderLiquidLevel(), 0.99F); - int[] displayLists = FluidRenderer.getLiquidDisplayLists(fluidStack); - if (displayLists != null) { - float level = Math.min(fluidStack.amount, cap) / cap; - bindTexture(FluidRenderer.getFluidSheet(fluidStack)); - GL11.glCallList(displayLists[(int) (level * (FluidRenderer.DISPLAY_STAGES - 1))]); - } - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopAttrib(); - GL11.glPopMatrix(); - - } - - @Override - public void renderTileEntityAt(TileEntity tile, double par2, double par4, double par6, float par8) { - this.renderAModelAt((IFluidTankVisual) tile, par2, par4, par6, par8); - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java deleted file mode 100644 index 4f7c529..0000000 --- a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java +++ /dev/null @@ -1,343 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.network.INetworkTileEntityEventListener; -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 ihl.interfaces.IFluidTankVisual; -import ihl.processing.chemistry.ApparatusProcessableInvSlot; -import ihl.processing.chemistry.ChemicalReactorTileEntity; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -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; - -public class ImpregnatingMachineTileEntity extends TileEntityInventory implements IHasGui,IFluidTankVisual,INetworkTileEntityEventListener, IFluidHandler -{ - private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("tub"); - public final ApparatusProcessableInvSlot input; - public final IHLInvSlotOutput outputSlot; - public final InvSlotConsumableLiquidIHL drainInputSlot; - public final InvSlotConsumableLiquidIHL fillInputSlot; - public final InvSlotOutput emptyFluidItemsSlot; - public short progress; - protected short operationLength=Short.MAX_VALUE/2; - private final IHLFluidTank fluidTank = new IHLFluidTank(8000); - public short temperature=20; - public int visibleFluidId = -1; - public int visibleFluidAmount = 1; - - public ImpregnatingMachineTileEntity() { - super(); - this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 2); - 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.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 1, 64); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankTag = new NBTTagCompound(); - this.fluidTank.writeToNBT(fluidTankTag); - nbttagcompound.setTag("fluidTank", fluidTankTag); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return false; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("tubBronze"); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public List getNetworkedFields() - { - List ret = super.getNetworkedFields(); - ret.add("visibleFluidId"); - ret.add("visibleFluidAmount"); - return ret; - } - - @Override - public void updateEntityServer() - { - if(this.fluidTank.getFluid()!=null) - { - if(this.fluidTank.getLigthestFluid().getFluid().isGaseous()) - { - this.fluidTank.drainLightest(10, true); - } - } - if(this.fluidTank.getFluid()!=null && (visibleFluidId!=this.fluidTank.getFluid().getFluid().getID() || visibleFluidAmount!=this.fluidTank.getFluidAmount())) - { - visibleFluidId = this.fluidTank.getFluid().getFluid().getID(); - visibleFluidAmount = this.fluidTank.getFluidAmount(); - IC2.network.get().updateTileEntityField(this, "visibleFluidId"); - IC2.network.get().updateTileEntityField(this, "visibleFluidAmount"); - } - else if(this.fluidTank.getFluid()==null && visibleFluidId!=-1) - { - visibleFluidId=-1; - IC2.network.get().updateTileEntityField(this, "visibleFluidId"); - } - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - if (this.canOperate()) - { - this.setActive(true); - if (this.progress == 0) - { - IC2.network.get().initiateTileEntityEvent(this, 0, true); - } - - this.progress+=this.operationLength/this.getOutput().getTime(); - 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 FluidStack drain(ForgeDirection from, int amount, boolean doDrain) - { - FluidStack fstack = this.fluidTank.drain(amount, doDrain); - return fstack; - } - - - //1.7.10 API - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return true; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid arg1) { - return true; - } - - @Override - public String getInventoryName() { - return "impregnatingMachine"; - } - - public float getRenderLiquidLevel() - { - return (float)this.visibleFluidAmount/(float)this.fluidTank.getCapacity(); - } - - @Override - public void onNetworkEvent(int event) - { - } - - public int gaugeProgressScaled(int i) - { - return this.progress * i / operationLength; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new ImpregnatingMachineGui(new ImpregnatingMachineContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) - { - this.fluidTank.sortFluidsByDensity(); - return new ImpregnatingMachineContainer(player, this); - } - - @Override - public void onGuiClosed(EntityPlayer player) {} - - public boolean canOperate() - { - return getOutput()!=null && this.outputSlot.canAdd(getOutput().getItemOutputs()); - } - - public UniversalRecipeOutput getOutput() - { - return ImpregnatingMachineTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @SuppressWarnings("rawtypes") - public List[] getInput() - { - for(int i=0;i getRecipes() { - return recipeManager.getRecipes(); - } - - public static void addQuenchingRecipe(String nameHot, String nameQuenched) - { - addRecipe(new UniversalRecipeInput((new FluidStack[] {new FluidStack(FluidRegistry.WATER, 50)}), (new ItemStack[] {IHLUtils.getThisModItemStack(nameHot)})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack(nameQuenched)}),2)); - } - - public IHLFluidTank getFluidTank() - { - return this.fluidTank; - } - - public static void addChemicalRecipe(UniversalRecipeInput universalRecipeInput, UniversalRecipeOutput universalRecipeOutput) - { - addRecipe(universalRecipeInput,universalRecipeOutput); - ChemicalReactorTileEntity.addRecipe(universalRecipeInput,universalRecipeOutput); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - - @Override - public int getVisibleFluidId() { - return this.visibleFluidId; - } - - @Override - public int getVisibleFluidAmount() { - return this.visibleFluidAmount; - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/InjectionMoldBlock.java b/ihl/processing/metallurgy/InjectionMoldBlock.java deleted file mode 100644 index bbea1cb..0000000 --- a/ihl/processing/metallurgy/InjectionMoldBlock.java +++ /dev/null @@ -1,248 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ihl.IHLCreativeTab; -import ihl.IHLModInfo; -import ihl.items_blocks.IHLItemBlock; -import ihl.metallurgy.constants.Details; -import ihl.utils.IHLUtils; -import net.minecraft.block.Block; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; - -public class InjectionMoldBlock extends Block implements ITileEntityProvider{ - - IIcon textureSide; - - public static InjectionMoldBlock instance; - public static String[] materials = new String[] {"Bronze","Steel","Gold","Magnesium", "Lithium", "TarPitch", "Potassium", "Sodium"}; - - public InjectionMoldBlock() - { - super(Material.rock); - this.setResistance(0.5F); - this.setHardness(0.5F); - this.setBlockName("injectionMold"); - this.setCreativeTab(IHLCreativeTab.tab); - instance=this; - } - - public static void init() - { - GameRegistry.registerBlock(new InjectionMoldBlock(),IHLItemBlock.class,"injectionMold"); - GameRegistry.registerTileEntity(InjectionMoldTileEntity.class,"injectionMoldTileEntity"); - } - - @Override - public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) - { - super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, flag); - } - - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) - { - ItemStack result = new ItemStack(item); - result.stackTagCompound=new NBTTagCompound(); - result.stackTagCompound.setString("resultSuffix", "ingot"); - itemList.add(result); - } - - - @Override - public TileEntity createNewTileEntity(World world, int var2) { - return new InjectionMoldTileEntity(); - } - - @Override - public void onBlockPreDestroy(World world, int x, int y, int z, int meta) - { - if(!world.isRemote) - { - TileEntity te = world.getTileEntity(x, y, z); - if(te!=null && te instanceof InjectionMoldTileEntity) - { - InjectionMoldTileEntity gte = (InjectionMoldTileEntity) te; - gte.dropContents(); - } - } - super.onBlockPreDestroy(world, x, y, z, meta); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) - { - ArrayList drops = new ArrayList(); - TileEntity t = world.getTileEntity(x, y, z); - if(t!=null) - { - InjectionMoldTileEntity te = (InjectionMoldTileEntity)t; - if(te.result!=null)drops.add(te.result); - if(te.result2!=null)drops.add(te.result2); - } - return drops; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":injectionMoldTop"); - this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":injectionMoldSide"); - } - - @Override - public boolean hasTileEntity(int metadata) - { - return true; - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) - { - TileEntity t = world.getTileEntity(x, y, z); - if(t!=null && t instanceof InjectionMoldTileEntity) - { - InjectionMoldTileEntity te = (InjectionMoldTileEntity)t; - te.resultSuffix=itemStack.stackTagCompound.getString("resultSuffix"); - if(itemStack.stackTagCompound.hasKey("isContainStearin")) - { - te.isContainStearin=itemStack.stackTagCompound.getBoolean("isContainStearin"); - } - if(itemStack.stackTagCompound.hasKey("maxAmount")) - { - te.maxAmount=itemStack.stackTagCompound.getByte("maxAmount"); - } - - } - } - @Override - public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int i,float pos_x,float pos_y,float pos_z) - { - if(player.getCurrentEquippedItem()!=null && player.getCurrentEquippedItem().getItem() instanceof Crucible) - { - if(!world.isRemote) - { - return ((Crucible)player.getCurrentEquippedItem().getItem()).onItemUse(player.getCurrentEquippedItem(), player, world, x, y, z, 0, pos_x, pos_y, pos_z); - } - return true; - } - return false; - } - - - - /** - * Called when the block is placed in the world. - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) - { - switch (side) - { - case 1: - return this.blockIcon; - case 0: - return this.textureSide; - case 2: - return this.textureSide; - case 3: - return this.textureSide; - case 4: - return this.textureSide; - case 5: - return this.textureSide; - default: - return this.textureSide; - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) - { - switch (side) - { - case 1: - return this.blockIcon; - case 0: - return this.textureSide; - case 2: - return this.textureSide; - case 3: - return this.textureSide; - case 4: - return this.textureSide; - case 5: - return this.textureSide; - default: - return this.textureSide; - } - } - - public ItemStack getSandInjectionMoldForResult(String result1) - { - ItemStack stack = new ItemStack(this); - stack.stackTagCompound=new NBTTagCompound(); - stack.stackTagCompound.setString("resultSuffix", result1); - registerRecipes(result1, stack); - return stack; - } - - public ItemStack getGypsumInjectionMoldForResult(String result1) - { - ItemStack stack = new ItemStack(this); - stack.stackTagCompound=new NBTTagCompound(); - stack.stackTagCompound.setString("resultSuffix", result1); - stack.stackTagCompound.setByte("maxAmount", (byte)1); - stack.stackTagCompound.setBoolean("isContainStearin", true); - registerRecipes(result1, stack); - return stack; - } - - public static void registerRecipes(String result1,ItemStack stack1) - { - for(int i=0;i16) - { - if(this.timer--==0) - { - String formattedFluidName=this.getFormattedMaterialName(this.getFluidfromTank().getName()); - if(formattedFluidName!="") - { - int fluidAmountPerItem = Details.getMeltingFluidAmount(this.resultSuffix); - ArrayList resultList = OreDictionary.getOres(this.resultSuffix+formattedFluidName); - if(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); - if(ro!=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(); - } - } - int fluidAmountPerItem2 = Details.getMeltingFluidAmount("nugget"); - ArrayList resultList2 = OreDictionary.getOres("nugget"+formattedFluidName); - if(!resultList.isEmpty()) - { - if(fluidAmountPerItem>0) - { - int stackSize1=Math.min(this.maxAmount,this.getFluidStackfromTank().amount/fluidAmountPerItem); - if(stackSize1>0) - { - result=resultList.get(0).copy(); - result.stackSize=stackSize1; - } - } - } - if(!resultList2.isEmpty()) - { - int stackSize1=this.getFluidStackfromTank().amount/fluidAmountPerItem2; - if(result!=null) - { - stackSize1=(this.getFluidStackfromTank().amount % fluidAmountPerItem)/fluidAmountPerItem2; - } - if(stackSize1>0) - { - result2=resultList2.get(0).copy(); - result2.stackSize=stackSize1; - } - } - } - } - } - } - - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return false; - } - - @Override - public boolean canFill(ForgeDirection direction, Fluid fluid1) { - return direction==ForgeDirection.UP && !isContainStearin; - } - - public String getInventoryName() { - return "injectionMold"; - } - - private String getFormattedMaterialName(String input) - { - String input2 = input.replace("molten.", "").replace(".molten", ""); - String firstletter = String.valueOf(input2.charAt(0)).toUpperCase(); - input2 = input2.replaceFirst(".", firstletter); - return input2; - } - - public FluidTank getFluidTank() - { - return this.fluidTank; - } - - public FluidStack getFluidStackfromTank() - { - return this.getFluidTank().getFluid(); - } - - public Fluid getFluidfromTank() - { - return this.getFluidStackfromTank().getFluid(); - } - - @Override - public int fill(ForgeDirection from, FluidStack resource, boolean doFill) - { - return this.canFill(from, resource.getFluid()) ? this.getFluidTank().fill(resource, doFill) : 0; - } - - @Override - public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) - { - return null; - } - - @Override - public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) - { - return this.getFluidTank().drain(maxDrain, doDrain); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection from) - { - return new FluidTankInfo[] {this.getFluidTank().getInfo()}; - } - - public void dropContents() - { - if(result!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, result)); - if(result2!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, result2)); - } - - public static Map getRecipes() - { - return recipeManager.getRecipes(); - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/LatheContainer.java b/ihl/processing/metallurgy/LatheContainer.java deleted file mode 100644 index 5e79a2a..0000000 --- a/ihl/processing/metallurgy/LatheContainer.java +++ /dev/null @@ -1,72 +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 LatheContainer extends ContainerBase { - - public LathePart1TileEntity tileEntity; - public int lastProgress = -1; - private short lastEnergy = -1; - private final static int height=166; - - public LatheContainer(EntityPlayer entityPlayer, - LathePart1TileEntity lathePart1TileEntity) { - super(lathePart1TileEntity); - tileEntity=lathePart1TileEntity; - 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(lathePart1TileEntity.dischargeSlot,0, 22, 55)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - if (this.tileEntity.getEnergy() != this.lastEnergy) - { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); - } - } - this.lastProgress = this.tileEntity.progress; - this.lastEnergy = (short) this.tileEntity.getEnergy(); - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - case 1: - this.tileEntity.setEnergy(value); - break; - } - } - -} diff --git a/ihl/processing/metallurgy/LatheGui.java b/ihl/processing/metallurgy/LatheGui.java deleted file mode 100644 index 16f64c5..0000000 --- a/ihl/processing/metallurgy/LatheGui.java +++ /dev/null @@ -1,51 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -public class LatheGui extends GuiContainer { - - private LatheContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUILathe.png"); - - public LatheGui(LatheContainer latheContainer) { - super(latheContainer); - container = latheContainer; - } - - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - 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); - int i1; - if (this.container.tileEntity.getEnergy() > 0D) - { - 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.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, 1.0F); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); - this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13); - } - } - - @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); - } -} diff --git a/ihl/processing/metallurgy/LathePart1Model.java b/ihl/processing/metallurgy/LathePart1Model.java deleted file mode 100644 index c08b3bf..0000000 --- a/ihl/processing/metallurgy/LathePart1Model.java +++ /dev/null @@ -1,93 +0,0 @@ -package ihl.processing.metallurgy; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class LathePart1Model extends ModelBase -{ - //fields - IHLModelRenderer Base; - IHLModelRenderer RotatingPart2; - IHLModelRenderer MotorPart1; - IHLModelRenderer MotorPart2; - IHLModelRenderer Belt; - IHLModelRenderer Belt2; - - public LathePart1Model() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 0); - setTextureOffset("Base.Shape3", 0, 0); - setTextureOffset("Base.Shape2", 0, 0); - setTextureOffset("Base.NewShape4", 0, 0); - setTextureOffset("RotatingPart2.PipeN1", 0, 0); - setTextureOffset("RotatingPart2.PipeN7", 49, 23); - setTextureOffset("RotatingPart2.Shape1", 56, 19); - setTextureOffset("RotatingPart2.Shape5", 0, 8); - setTextureOffset("RotatingPart2.Shape8", 0, 11); - setTextureOffset("RotatingPart2.PipeN4", 0, 0); - setTextureOffset("RotatingPart2.Shape9", 0, 0); - setTextureOffset("MotorPart1.PipeN41", 0, 0); - setTextureOffset("MotorPart1.PipeN12", 0, 0); - setTextureOffset("MotorPart1.PipeN13", 0, 0); - setTextureOffset("MotorPart2.Shape4", 0, 24); - setTextureOffset("MotorPart2.Shape7", 0, 9); - setTextureOffset("MotorPart2.Shape10", 0, 9); - setTextureOffset("Belt.Shape12", 46, 0); - setTextureOffset("Belt2.Shape13", 46, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); - Base.addBox("Shape3", -5.5F, -1.5F, -7F, 7, 9, 1); - Base.addBox("Shape2", -5.5F, -0.5F, -4F, 5, 8, 1); - Base.addBox("NewShape4", 3F, 3F, -6F, 3, 4, 1); - RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); - RotatingPart2.setRotationPoint(-3F, 18F, -7F); - setRotation(RotatingPart2, 0F, 0F, 0F); - RotatingPart2.mirror = true; - RotatingPart2.addTube("PipeN1", -1.5F, -1.5F, 0F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN7", -2.5F, -2.5F, -1F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addBox("Shape1", 2F, -0.5F, 8.5F, 3, 1, 1); - RotatingPart2.addBox("Shape5", -0.5F, -5F, 8.5F, 1, 3, 1); - RotatingPart2.addBox("Shape8", -5F, -0.5F, 8.5F, 3, 1, 1); - RotatingPart2.addTube("PipeN4", -4F, -4F, 4F, 8, 8, 5, 0.3F,1F,ForgeDirection.NORTH); - RotatingPart2.addBox("Shape9", -0.5F, 2F, 8.5F, 1, 3, 1); - MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); - MotorPart1.setRotationPoint(0F, 21F, 0F); - setRotation(MotorPart1, 0F, 0F, 0F); - MotorPart1.mirror = true; - MotorPart1.addTube("PipeN41", 3F, -2F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN12", 4F, -1F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN13", 3F, -2F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); - MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); - MotorPart2.setRotationPoint(0F, 16F, 0F); - setRotation(MotorPart2, 0F, 0F, 0F); - MotorPart2.mirror = true; - MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); - MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); - MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); - Belt = new IHLModelRenderer(this, "Belt"); - Belt.setRotationPoint(-3F, 15.5F, -7.9F); - setRotation(Belt, 0F, 0F, 0.45F); - Belt.mirror = true; - Belt.addBox("Shape12", 0F, 0F, 0F, 8, 1, 1); - Belt2 = new IHLModelRenderer(this, "Belt2"); - Belt2.setRotationPoint(-3F, 19.5F, -7.9F); - setRotation(Belt2, 0F, 0F, 0.19F); - Belt2.mirror = true; - Belt2.addBox("Shape13", 0F, 0F, 0F, 8, 1, 1); - } - - 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/LathePart1TileEntity.java b/ihl/processing/metallurgy/LathePart1TileEntity.java deleted file mode 100644 index 788bfd4..0000000 --- a/ihl/processing/metallurgy/LathePart1TileEntity.java +++ /dev/null @@ -1,99 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.ContainerBase; -import ihl.interfaces.IWorkspaceElement; -import ihl.utils.IHLUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class LathePart1TileEntity extends BasicElectricMotorTileEntity implements IWorkspaceElement{ - - public boolean ready=false; - - public LathePart1TileEntity() - { - super(); - } - - - @Override - public String getInventoryName() { - return "Lathe"; - } - - @Override - public void operate() - { - ready=true; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("lathePart1"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new LatheGui(new LatheContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new LatheContainer(player, this); - } - - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public List[] getInput() - { - return null; - } - - @Override - public boolean canOperate() - { - TileEntity te = worldObj.getTileEntity(xCoord+ForgeDirection.getOrientation(getFacing()).offsetX,yCoord,zCoord+ForgeDirection.getOrientation(getFacing()).offsetZ); - if(te!=null && te instanceof LathePart2TileEntity) - { - return !ready; - } - return false; - } - - @Override - public void onGuiClosed(EntityPlayer arg0) {} - - @Override - public boolean canBeUsed() - { - return ready; - } - - @Override - public void use() - { - ready=false; - } - - @Override - public boolean getIsInvalid() - { - return this.isInvalid(); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } -} diff --git a/ihl/processing/metallurgy/LathePart2Model.java b/ihl/processing/metallurgy/LathePart2Model.java deleted file mode 100644 index 40b9b2a..0000000 --- a/ihl/processing/metallurgy/LathePart2Model.java +++ /dev/null @@ -1,87 +0,0 @@ -package ihl.processing.metallurgy; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class LathePart2Model extends ModelBase -{ - //fields - IHLModelRenderer Base; - - public LathePart2Model() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 0); - setTextureOffset("Base.Shape1", 0, 0); - setTextureOffset("Base.Shape2", 38, 5); - setTextureOffset("Base.Shape3", 0, 0); - setTextureOffset("Base.Shape4", 0, 0); - setTextureOffset("Base.Shape5", 0, 0); - setTextureOffset("Base.PipeN7", 0, 0); - setTextureOffset("Base.Shape7", 0, 0); - setTextureOffset("Base.PipeW9", 0, 0); - setTextureOffset("Base.PipeW9", 0, 0); - setTextureOffset("Base.Shape9", 0, 0); - setTextureOffset("Base.Shape10", 0, 0); - setTextureOffset("Base.Shape11", 0, 0); - setTextureOffset("Base.Shape12", 0, 0); - setTextureOffset("Base.PipeW13", 0, 0); - setTextureOffset("Base.PipeN13", 0, 0); - setTextureOffset("Base.Shape13", 0, 0); - setTextureOffset("Base.Shape14", 0, 0); - setTextureOffset("Base.PipeU15", 0, 0); - setTextureOffset("Base.PipeU16", 0, 0); - setTextureOffset("Base.PipeU17", 0, 0); - setTextureOffset("Base.PipeU18", 0, 0); - setTextureOffset("Base.Shape15", 0, 0); - setTextureOffset("Base.Shape16", 0, 0); - setTextureOffset("Base.PipeW20", 0, 0); - setTextureOffset("Base.PipeW19", 0, 0); - setTextureOffset("Base.PipeN21", 0, 0); - setTextureOffset("Base.PipeN22", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 14, 1, 16); - Base.addBox("Shape1", 0F, 1F, 0F, 4, 1, 4); - Base.addBox("Shape2", -2F, 2F, 1F, 5, 1, 1); - Base.addBox("Shape3", 0F, 3F, 0F, 4, 2, 4); - Base.addBox("Shape4", 2F, 6F, -8F, 1, 1, 16); - Base.addBox("Shape5", 5F, 6F, -8F, 1, 1, 13); - Base.addTube("PipeN7", 3.5F, 6F, -7F, 1, 1, 12, 0F,1F,ForgeDirection.NORTH); - Base.addBox("Shape7", 3F, 6F, -8F, 2, 1, 1); - Base.addTube("PipeW9", 6F, 5F, 5F, 1, 3, 3, 0F,1F,ForgeDirection.WEST); - Base.addTube("PipeW9", 7F, 6F, 5.2F, 1, 1, 1, 0F,1F,ForgeDirection.WEST); - Base.addBox("Shape9", 3F, 5F, 5F, 3, 2, 3); - Base.addBox("Shape10", -2F, 5F, 0F, 8, 1, 1); - Base.addBox("Shape11", -2F, 5F, 3F, 8, 1, 1); - Base.addBox("Shape12", 1F, 5F, 1F, 2, 1, 2); - Base.addTube("PipeW13", -1F, 5F, 1.5F, 6, 1, 1, 0F,1F,ForgeDirection.WEST); - Base.addTube("PipeN13", -4F, 1F, 3F, 2, 2, 3, 0F,1F,ForgeDirection.NORTH); - Base.addBox("Shape13", -3.5F, 2F, 3.8F, 1, 5, 2); - Base.addBox("Shape14", -4.5F, 6F, 2F, 3, 1, 4); - Base.addTube("PipeU15", 0F, 2F, 3F, 1, 1, 1, 0F,1F,ForgeDirection.UP); - Base.addTube("PipeU16", 3F, 2F, 3F, 1, 1, 1, 0F,1F,ForgeDirection.UP); - Base.addTube("PipeU17", 3F, 2F, 0F, 1, 1, 1, 0F,1F,ForgeDirection.UP); - Base.addTube("PipeU18", 0F, 2F, 0F, 1, 1, 1, 0F,1F,ForgeDirection.UP); - Base.addBox("Shape15", 5F, 5F, 1F, 1, 1, 2); - Base.addBox("Shape16", -2F, 5F, 1F, 1, 1, 2); - Base.addTube("PipeW20", 6F, 4F, 0.5F, 1, 3, 3, 0F,1F,ForgeDirection.WEST); - Base.addTube("PipeW19", 7F, 5F, 0.8F, 1, 1, 1, 0F,1F,ForgeDirection.WEST); - Base.addTube("PipeN21", -4.5F, 0.5F, 6F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); - Base.addTube("PipeN22", -3F, 1F, 7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); - } - - 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/LathePart2TileEntity.java b/ihl/processing/metallurgy/LathePart2TileEntity.java deleted file mode 100644 index 7d4dac7..0000000 --- a/ihl/processing/metallurgy/LathePart2TileEntity.java +++ /dev/null @@ -1,104 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.ArrayList; -import java.util.List; - -import ic2.api.network.INetworkDataProvider; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ihl.utils.IHLUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class LathePart2TileEntity extends TileEntity implements IWrenchable, INetworkDataProvider{ - - private short facing=2; - private short lastFacing=2; - - public LathePart2TileEntity() - { - super(); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public List getNetworkedFields() - { - List fields = new ArrayList(); - fields.add("facing"); - return fields; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if(lastFacing!=facing) - { - IC2.network.get().updateTileEntityField(this, "facing"); - lastFacing=facing; - } - } - - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=side; - } - - - @Override - public short getFacing() { - return this.facing; - } - - - @Override - public void setFacing(short facing1) - { - facing=(short) Math.max(2,facing1); - if(IC2.platform.isSimulating()) - { - IC2.network.get().updateTileEntityField(this, "facing"); - lastFacing=facing; - } - } - - - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } - - - @Override - public float getWrenchDropRate() { - return 1F; - } - - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("lathePart2"); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - facing=nbttagcompound.getShort("facing"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - nbttagcompound.setShort("facing", facing); - } -} diff --git a/ihl/processing/metallurgy/MachineBaseContainer.java b/ihl/processing/metallurgy/MachineBaseContainer.java deleted file mode 100644 index d7e3ac7..0000000 --- a/ihl/processing/metallurgy/MachineBaseContainer.java +++ /dev/null @@ -1,74 +0,0 @@ -package ihl.processing.metallurgy; - -import ic2.core.ContainerBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; - -public class MachineBaseContainer extends ContainerBase { - - protected MachineBaseTileEntity tileEntity; - public int lastProgress = -1; - private short lastEnergy; - private final static int height=166; - - public MachineBaseContainer(EntityPlayer entityPlayer, MachineBaseTileEntity tileEntity1){ - super(tileEntity1); - this.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)); - } - - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - if (this.tileEntity.getEnergy() != this.lastEnergy) - { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); - } - } - this.lastProgress = this.tileEntity.progress; - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - case 1: - this.tileEntity.setEnergy(value); - break; - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return tileEntity.isUseableByPlayer(var1); - } -} diff --git a/ihl/processing/metallurgy/MachineBaseTileEntity.java b/ihl/processing/metallurgy/MachineBaseTileEntity.java deleted file mode 100644 index 79763b5..0000000 --- a/ihl/processing/metallurgy/MachineBaseTileEntity.java +++ /dev/null @@ -1,279 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergySink; -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 ihl.processing.chemistry.ApparatusProcessableInvSlot; -import ihl.recipes.UniversalRecipeOutput; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - -public abstract class MachineBaseTileEntity extends TileEntityInventory implements IHasGui, IEnergySink -{ - public short progress; - protected short operationLength=200; - protected double energy; - public int maxStorage; - public int energyConsume; - public final ApparatusProcessableInvSlot input; - private boolean addedToEnergyNet=false; - - public MachineBaseTileEntity(int inputCount) - { - input = new ApparatusProcessableInvSlot(this, "input", 0, Access.IO, inputCount, 64); - maxStorage=128; - energyConsume=5; - } - @Override - public List getNetworkedFields() - { - List fields = super.getNetworkedFields(); - return fields; - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - this.progress = nbttagcompound.getShort("progress"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - nbttagcompound.setShort("progress", this.progress); - } - - @Override - public void onLoaded() - { - super.onLoaded(); - if (IC2.platform.isSimulating()&&!this.addedToEnergyNet) - { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - this.addedToEnergyNet = true; - } - } - - @Override - public void onUnloaded() - { - if (IC2.platform.isSimulating()&&this.addedToEnergyNet) - { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - this.addedToEnergyNet = false; - } - - super.onUnloaded(); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=(short)side; - } - - @Override - public void setFacing(short facing1) - { - if (IC2.platform.isSimulating()&&this.addedToEnergyNet) - { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - this.addedToEnergyNet = false; - } - super.setFacing(facing1); - if (IC2.platform.isSimulating()&&!this.addedToEnergyNet) - { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - this.addedToEnergyNet = true; - } - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - public abstract String getStartSoundFile(); - - public abstract String getLoopSoundFile(); - - public abstract String getStopSoundFile(); - - @Override - public void updateEntityServer() - { - if(this.energy>this.maxStorage) - { - this.energy=this.maxStorage; - } - - if (this.canOperate() && this.energy >= this.energyConsume) - { - this.setActive(true); - - if (this.progress == 0) - { - IC2.network.get().initiateTileEntityEvent(this, 0, true); - } - - ++this.progress; - this.energy -= this.energyConsume; - - 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); - } - } - - protected int mX() - { - switch(this.getFacing()) - { - case 4: - return 1; - case 5: - return -1; - default: - return 0; - } - } - - protected int mY() - { - switch(this.getFacing()) - { - case 0: - return -1; - case 1: - return 1; - default: - return 0; - } - } - - protected int mZ() - { - switch(this.getFacing()) - { - case 2: - return 1; - case 3: - return -1; - default: - return 0; - } - } - - @Override - public abstract String getInventoryName(); - - @Override - @SideOnly(Side.CLIENT) - public abstract GuiScreen getGui(EntityPlayer arg0, boolean arg1); - - @Override - public abstract ContainerBase getGuiContainer(EntityPlayer arg0); - - @Override - public void onGuiClosed(EntityPlayer arg0) {} - - public int gaugeProgressScaled(int i) - { - return this.progress * i / this.operationLength; - } - - public boolean canOperate() - { - return getOutput()!=null; - } - - public abstract UniversalRecipeOutput getOutput(); - - @SuppressWarnings("rawtypes") - public List[] getInput() - { - return new List[]{null, this.input.getItemStackList()}; - } - - - @Override - public double getDemandedEnergy() - { - return this.maxStorage - this.energy; - } - - @Override - public int getSinkTier() - { - return 4; - } - - @Override - public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) - { - if (this.energy >= this.maxStorage) - { - return amount; - } - else - { - this.energy += amount; - return 0.0D; - } - } - - @Override - public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) - { - return true; - } - - - public abstract void operate(); - public short getEnergy() { - return (short)this.energy; - } - public void setEnergy(int value) - { - this.energy=value; - } - public int getGUIEnergy(int i) { - if(this.energy 0D) - { - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(8, 6 + 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(70,34, 197, 0, i1 + 1, 13); - } - fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ihl.gui.muffleFurnace"), 40, 12, 16768125); - - } - - @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(muffleFurnaceBackground); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/ihl/processing/metallurgy/MuffleFurnanceContainer.java b/ihl/processing/metallurgy/MuffleFurnanceContainer.java deleted file mode 100644 index 1ae7203..0000000 --- a/ihl/processing/metallurgy/MuffleFurnanceContainer.java +++ /dev/null @@ -1,16 +0,0 @@ -package ihl.processing.metallurgy; - -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; - -public class MuffleFurnanceContainer extends MachineBaseContainer { - - public MuffleFurnanceContainer(EntityPlayer entityPlayer, - MuffleFurnanceTileEntity tileEntity1) { - super(entityPlayer, tileEntity1); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 40, 22)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 40, 40)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 98, 32)); - } - -} diff --git a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java deleted file mode 100644 index 6f811cb..0000000 --- a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java +++ /dev/null @@ -1,119 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.recipe.IRecipeInput; -import ic2.core.ContainerBase; -import ihl.IHLMod; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.recipes.RecipeOutputItemStack; -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; - -public class MuffleFurnanceTileEntity extends MachineBaseTileEntity { - - protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("mufflefurnace"); - public final IHLInvSlotOutput outputSlot; - - public MuffleFurnanceTileEntity() { - super(2); - this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); - } - - @Override - public String getStartSoundFile() { - return null; - } - - @Override - public String getLoopSoundFile() { - return null; - } - - @Override - public String getStopSoundFile() { - return null; - } - - @Override - public String getInventoryName() { - return "MuffleFurnance"; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new MuffleFurnaceGui(new MuffleFurnanceContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new MuffleFurnanceContainer(player, this); - } - - @Override - public boolean canOperate() { - ItemStack crucible = input.getItemStack(IHLMod.crucible); - if (crucible != null) { - return true; - } - ItemStack mold = input.getItemStack(IHLUtils.getThisModItem("injectionMold")); - if (mold != null) { - return true; - } - return getOutput() != null; - } - - @Override - public void operate() { - ItemStack crucible = input.getItemStack(IHLMod.crucible); - if (crucible != null) { - ((Crucible) crucible.getItem()).processContent(crucible, this); - return; - } - ItemStack mold = input.getItemStack(IHLUtils.getThisModItem("injectionMold")); - if (mold != null) { - mold.stackTagCompound.setBoolean("isContainStearin", false); - return; - } - List output = recipeManager - .getOutputFor(getInput()).getItemOutputs(); - List rinput = recipeManager.getRecipeInput(getInput()).getItemInputs(); - for (int i = 0; i < rinput.size(); i++) { - this.input.consume(rinput.get(i)); - } - this.outputSlot.add(output); - } - - public static void addRecipe(IRecipeInput recipeInputOreDict, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { recipeInputOreDict })), - new UniversalRecipeOutput(null, (new ItemStack[] { output }), 20)); - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - @Override - public UniversalRecipeOutput getOutput() { - return MuffleFurnanceTileEntity.recipeManager.getOutputFor(null, this.input.getItemStackList()); - } - - public static void addRecipe(UniversalRecipeInput universalRecipeInput, - UniversalRecipeOutput universalRecipeOutput) { - recipeManager.addRecipe(universalRecipeInput, universalRecipeOutput); - } - - public static void addRecipe(IRecipeInput recipeInputOreDict, ItemStack output, float f) { - recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { recipeInputOreDict })), new UniversalRecipeOutput( - null, (new RecipeOutputItemStack[] { new RecipeOutputItemStack(output, f) }), 20)); - } -} diff --git a/ihl/processing/metallurgy/RollingMachineContainer.java b/ihl/processing/metallurgy/RollingMachineContainer.java deleted file mode 100644 index 7a83d9d..0000000 --- a/ihl/processing/metallurgy/RollingMachineContainer.java +++ /dev/null @@ -1,75 +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 RollingMachineContainer extends ContainerBase { - - public RollingMachinePart1TileEntity tileEntity; - public int lastProgress = -1; - private short lastEnergy = -1; - private final static int height=166; - - public RollingMachineContainer(EntityPlayer entityPlayer, - RollingMachinePart1TileEntity lathePart1TileEntity) { - super(lathePart1TileEntity); - tileEntity=lathePart1TileEntity; - 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(lathePart1TileEntity.input, 0, 54, 25)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 105, 25)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - if (this.tileEntity.getEnergy() != this.lastEnergy) - { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); - } - } - this.lastProgress = this.tileEntity.progress; - this.lastEnergy = (short) this.tileEntity.getEnergy(); - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - case 1: - this.tileEntity.setEnergy(value); - break; - } - } - -} diff --git a/ihl/processing/metallurgy/RollingMachineGui.java b/ihl/processing/metallurgy/RollingMachineGui.java deleted file mode 100644 index a792bd3..0000000 --- a/ihl/processing/metallurgy/RollingMachineGui.java +++ /dev/null @@ -1,50 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -public class RollingMachineGui extends GuiContainer { - - private RollingMachineContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIRollingMachine.png"); - - public RollingMachineGui(RollingMachineContainer latheContainer) { - super(latheContainer); - container = latheContainer; - } - - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(tex); - int i1; - if (this.container.tileEntity.getEnergy() > 0D) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - 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.progress > 0) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); - this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13); - } - } - - @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); - } -} diff --git a/ihl/processing/metallurgy/RollingMachinePart1Model.java b/ihl/processing/metallurgy/RollingMachinePart1Model.java deleted file mode 100644 index fe062f8..0000000 --- a/ihl/processing/metallurgy/RollingMachinePart1Model.java +++ /dev/null @@ -1,97 +0,0 @@ -package ihl.processing.metallurgy; - - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - - -public class RollingMachinePart1Model extends ModelBase -{ - //fields - IHLModelRenderer Base; - IHLModelRenderer RotatingPart2; - IHLModelRenderer MotorPart1; - IHLModelRenderer MotorPart2; - IHLModelRenderer RotatingPart1; - IHLModelRenderer Plate; - - public RollingMachinePart1Model() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 0); - setTextureOffset("Base.Shape16", 0, 0); - setTextureOffset("Base.Shape5", 0, 0); - setTextureOffset("Base.Shape8", 0, 0); - setTextureOffset("Base.Shape11", 0, 0); - setTextureOffset("Base.Shape9", 0, 0); - setTextureOffset("RotatingPart2.PipeN7", 0, 0); - setTextureOffset("RotatingPart2.PipeN17", 0, 0); - setTextureOffset("RotatingPart2.Shape3", 0, 0); - setTextureOffset("RotatingPart2.Shape12", 0, 0); - setTextureOffset("MotorPart1.PipeN41", 0, 0); - setTextureOffset("MotorPart1.PipeN12", 0, 0); - setTextureOffset("MotorPart1.PipeN13", 0, 0); - setTextureOffset("MotorPart2.Shape4", 0, 24); - setTextureOffset("MotorPart2.Shape7", 0, 9); - setTextureOffset("MotorPart2.Shape10", 0, 9); - setTextureOffset("RotatingPart1.Shape1", 0, 0); - setTextureOffset("RotatingPart1.Shape2", 0, 0); - setTextureOffset("RotatingPart1.Shape13", 0, 0); - setTextureOffset("Plate.Shape14", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); - Base.addBox("Shape16", -3F, -7F, -6F, 9, 14, 1); - Base.addBox("Shape5", 2F, -1F, -5F, 6, 1, 13); - Base.addBox("Shape8", -8F, -1F, -5F, 6, 1, 13); - Base.addBox("Shape11", 3F, 0F, 7F, 4, 7, 1); - Base.addBox("Shape9", -7F, 0F, 7F, 4, 7, 1); - RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); - RotatingPart2.setRotationPoint(0F, 16F, -7F); - setRotation(RotatingPart2, 0F, 0F, 0F); - RotatingPart2.mirror = true; - RotatingPart2.addTube("PipeN7", -5.5F, -5.5F, -0.9F, 11, 11, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN17", -2F, -2F, 2F, 4, 4, 26, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("Shape3", -2.5F, -2.5F, 0F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("Shape12", -1F, -1F, 28F, 2, 2, 3, 0F,1F,ForgeDirection.NORTH); - MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); - MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); - setRotation(MotorPart1, 0F, 0F, 0F); - MotorPart1.mirror = true; - MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); - MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); - MotorPart2.setRotationPoint(0F, 16F, 0F); - setRotation(MotorPart2, 0F, 0F, 0F); - MotorPart2.mirror = true; - MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); - MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); - MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); - RotatingPart1 = new IHLModelRenderer(this, "RotatingPart1"); - RotatingPart1.setRotationPoint(0F, 11.9F, -5F); - setRotation(RotatingPart1, 0F, 0F, 0F); - RotatingPart1.mirror = true; - RotatingPart1.addTube("Shape1", -2F, -2F, 0F, 4, 4, 26, 0F,1F,ForgeDirection.NORTH); - RotatingPart1.addTube("Shape2", -2.5F, -2.5F, -1.9F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart1.addTube("Shape13", -1F, -1F, 26F, 2, 2, 3, 0F,1F,ForgeDirection.NORTH); - Plate = new IHLModelRenderer(this, "Plate"); - Plate.setRotationPoint(0F, 13.5F, 0F); - setRotation(Plate, 0F, 0F, 0F); - Plate.mirror = true; - Plate.addBox("Shape14", -18F, 0F, 0F, 16, 1, 16); - } - - 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/RollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java deleted file mode 100644 index da60877..0000000 --- a/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java +++ /dev/null @@ -1,149 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.recipe.IRecipeInput; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.block.invslot.InvSlot.Access; -import ihl.processing.chemistry.ApparatusProcessableInvSlot; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.recipes.RecipeOutputItemStack; -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 net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ - - public final ApparatusProcessableInvSlot input; - public final IHLInvSlotOutput output; - public boolean assembled; - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("rollingmachine"); - - public RollingMachinePart1TileEntity() - { - super(); - input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64); - output = new IHLInvSlotOutput(this, "output", 2, 1); - } - - public UniversalRecipeOutput getOutput() - { - return RollingMachinePart1TileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @Override - public List getNetworkedFields() - { - List fields = super.getNetworkedFields(); - fields.add("assembled"); - return fields; - } - - - @Override - public String getInventoryName() { - return "RollingMachine"; - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - if(assembled && !this.checkCorrectAccembly()) - { - assembled=false; - IC2.network.get().updateTileEntityField(this, "assembled"); - } - else if(!assembled && this.checkCorrectAccembly()) - { - assembled=true; - IC2.network.get().updateTileEntityField(this, "assembled"); - } - if (this.getActive() && this.progress == 0 && !this.canOperate()) - { - this.setActive(false); - } - - if (!this.getActive() && this.progress>0 && this.canOperate()) - { - this.setActive(true); - } - - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("rollingMachinePart1"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new RollingMachineGui(new RollingMachineContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new RollingMachineContainer(player, this); - } - - @Override - public void operate() - { - List rinput = recipeManager.getRecipeInput(getInput()).getItemInputs(); - List output = RollingMachinePart1TileEntity.recipeManager.getOutputFor(getInput()).getItemOutputs(); - this.output.add(output); - this.input.consume(rinput.get(0)); - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public List[] getInput() - { - return new List[]{null, Arrays.asList(new ItemStack[] {input.get()})}; - } - - @Override - public boolean canOperate() - { - return this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); - } - - private boolean checkCorrectAccembly() - { - TileEntity te = worldObj.getTileEntity(xCoord+ForgeDirection.getOrientation(getFacing()).offsetX,yCoord+ForgeDirection.getOrientation(getFacing()).offsetY,zCoord+ForgeDirection.getOrientation(getFacing()).offsetZ); - return te!=null && te instanceof RollingMachinePart2TileEntity && ((RollingMachinePart2TileEntity)te).getFacing()==this.getFacing(); - } - - @Override - public void onGuiClosed(EntityPlayer arg0) {} - - public static void addRecipe(ItemStack input, ItemStack output) - { - recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input})), new UniversalRecipeOutput(null, (new ItemStack[] {output}), 20)); - } - - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - -} diff --git a/ihl/processing/metallurgy/RollingMachinePart2Model.java b/ihl/processing/metallurgy/RollingMachinePart2Model.java deleted file mode 100644 index 39fd1f5..0000000 --- a/ihl/processing/metallurgy/RollingMachinePart2Model.java +++ /dev/null @@ -1,42 +0,0 @@ -package ihl.processing.metallurgy; - - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; - -public class RollingMachinePart2Model extends ModelBase -{ - //fields - IHLModelRenderer Base; - - public RollingMachinePart2Model() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 0); - setTextureOffset("Base.Shape16", 0, 0); - setTextureOffset("Base.Shape5", 0, 0); - setTextureOffset("Base.Shape8", 0, 0); - setTextureOffset("Base.Shape11", 0, 0); - setTextureOffset("Base.Shape9", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); - Base.addBox("Shape16", -3F, -7F, 5F, 6, 14, 1); - Base.addBox("Shape5", 2F, -1F, -8F, 6, 1, 13); - Base.addBox("Shape8", -8F, -1F, -8F, 6, 1, 13); - Base.addBox("Shape11", 3F, 0F, -8F, 4, 7, 1); - Base.addBox("Shape9", -7F, 0F, -8F, 4, 7, 1); - } - - 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/RollingMachinePart2TileEntity.java b/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java deleted file mode 100644 index 13f4f6c..0000000 --- a/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java +++ /dev/null @@ -1,104 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.ArrayList; -import java.util.List; - -import ic2.api.network.INetworkDataProvider; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ihl.utils.IHLUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class RollingMachinePart2TileEntity extends TileEntity implements IWrenchable, INetworkDataProvider{ - - private short facing=2; - private short lastFacing=2; - - public RollingMachinePart2TileEntity() - { - super(); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public List getNetworkedFields() - { - List fields = new ArrayList(); - fields.add("facing"); - return fields; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if(lastFacing!=facing) - { - IC2.network.get().updateTileEntityField(this, "facing"); - lastFacing=facing; - } - } - - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=side; - } - - - @Override - public short getFacing() { - return this.facing; - } - - - @Override - public void setFacing(short facing1) - { - facing=(short) Math.max(2,facing1); - if(IC2.platform.isSimulating()) - { - IC2.network.get().updateTileEntityField(this, "facing"); - } - } - - - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } - - - @Override - public float getWrenchDropRate() { - return 1F; - } - - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("rollingMachinePart2"); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - facing=nbttagcompound.getShort("facing"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - nbttagcompound.setShort("facing", facing); - } - -} diff --git a/ihl/processing/metallurgy/RollingMachineRender.java b/ihl/processing/metallurgy/RollingMachineRender.java deleted file mode 100644 index f347a73..0000000 --- a/ihl/processing/metallurgy/RollingMachineRender.java +++ /dev/null @@ -1,81 +0,0 @@ -package ihl.processing.metallurgy; -import org.lwjgl.opengl.GL11; - -import ic2.api.tile.IWrenchable; -import ihl.IHLModInfo; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -public class RollingMachineRender extends TileEntitySpecialRenderer{ -private RollingMachinePart1Model model = new RollingMachinePart1Model(); -private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/coiler.png"); -private final float scale=1F/16F; - - public RollingMachineRender() {} - - - @Override - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par8) - { - int rotation = 0; - if(tile.getWorldObj() != null) - { - switch (((IWrenchable)tile).getFacing()) - { - case 2: - rotation = 0; - break; - case 5: - rotation = 1; - break; - case 3: - rotation = 2; - break; - case 4: - rotation = 3; - break; - default: - rotation = 0; - } - } - else - { - return; - } - RollingMachinePart1TileEntity cte = (RollingMachinePart1TileEntity)tile; - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F); - - bindTexture(tex); - model.Base.render(scale); - if(cte.getActive()) - { - model.RotatingPart1.rotateAngleZ-=0.01F; - model.RotatingPart2.rotateAngleZ+=0.01F; - model.RotatingPart1.render(scale); - model.RotatingPart2.render(scale); - model.MotorPart1.rotateAngleZ-=0.03F; - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - model.Plate.offsetX+=0.001F; - if(model.Plate.offsetX>1F){model.Plate.offsetX=0;} - model.Plate.render(scale); - } - else - { - model.Plate.offsetX=0F; - if(cte.assembled) - { - model.RotatingPart1.render(scale); - model.RotatingPart2.render(scale); - } - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - } - GL11.glPopMatrix(); //end - - } -} \ No newline at end of file diff --git a/ihl/processing/metallurgy/VulcanizationExtrudingMoldModel.java b/ihl/processing/metallurgy/VulcanizationExtrudingMoldModel.java deleted file mode 100644 index 9ce0f01..0000000 --- a/ihl/processing/metallurgy/VulcanizationExtrudingMoldModel.java +++ /dev/null @@ -1,54 +0,0 @@ -package ihl.processing.metallurgy; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class VulcanizationExtrudingMoldModel extends ModelBase -{ - //fields - IHLModelRenderer Base; - - public VulcanizationExtrudingMoldModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 0); - setTextureOffset("Base.Shape3", 0, 0); - setTextureOffset("Base.Shape16", 0, 0); - setTextureOffset("Base.PipeW161", 0, 0); - setTextureOffset("Base.PipeN16", 0, 0); - setTextureOffset("Base.PipeW15", 22, 22); - setTextureOffset("Base.PipeW17", 0, 0); - setTextureOffset("Base.Shape14", 0, 0); - setTextureOffset("Base.PipeN14", 0, 0); - setTextureOffset("Base.Shape2", 0, 0); - setTextureOffset("Base.Shape4", 42, 17); - setTextureOffset("Base.Shape5", 37, 17); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); - Base.addBox("Shape3", -5F, 0F, -7F, 4, 7, 1); - Base.addBox("Shape16", 6.9F, 3F, -1.5F, 1, 4, 3); - Base.addTube("PipeW161", -7F, 0.5F, -1.5F, 15, 3, 3, 0.5F,1F,ForgeDirection.WEST); - Base.addTube("PipeN16", -4.5F, 0.5F, -6F, 3, 3, 6, 0.8F,1F,ForgeDirection.NORTH); - Base.addTube("PipeW15", -5.5F, -0.5F, -2.5F, 12, 5, 5, 0.5F,1F,ForgeDirection.WEST); - Base.addTube("PipeW17", -8F, -0.5F, -2.5F, 1, 5, 5, 0.1F,1F,ForgeDirection.WEST); - Base.addBox("Shape14", -5F, 3F, -4.9F, 4, 4, 1); - Base.addTube("PipeN14", -5.5F, -0.5F, -8F, 5, 5, 1, 0.5F,1F,ForgeDirection.NORTH); - Base.addBox("Shape2", -7F, 3F, -1.5F, 1, 4, 3); - Base.addBox("Shape4", 5F, 3F, 1F, 1, 4, 1); - Base.addBox("Shape5", 5F, 6F, 2F, 3, 1, 1); - } - - 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/VulcanizationExtrudingMoldTileEntity.java b/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java deleted file mode 100644 index bb51ced..0000000 --- a/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java +++ /dev/null @@ -1,256 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergySink; -import ic2.api.network.INetworkDataProvider; -import ic2.api.recipe.IRecipeInput; -import ic2.api.recipe.RecipeInputItemStack; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ihl.items_blocks.FlexibleCableItem; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLUtils; -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.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class VulcanizationExtrudingMoldTileEntity extends TileEntity - implements IWrenchable, INetworkDataProvider, IEnergySink, IProductionLine, IFluidHandler { - - private short facing = 2; - private short lastFacing = 2; - public double energy; - public int maxStorage = 64; - private double energyConsume = 16D; - private boolean addedToEnergyNet = false; - private FluidTank fluidTank = new FluidTank(5000); - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager( - "vulcanizationextrudingmold"); - - public VulcanizationExtrudingMoldTileEntity() { - super(); - } - - public static void addRecipe(FluidStack inputFluid, ItemStack input, ItemStack output1) { - recipeManager.addRecipe( - new UniversalRecipeInput((new FluidStack[] { inputFluid }), - (new IRecipeInput[] { new RecipeInputItemStack(input) })), - new UniversalRecipeOutput(null, (new ItemStack[] { output1 }), 200)); - } - - public boolean enableUpdateEntity() { - return IC2.platform.isSimulating(); - } - - @Override - public void invalidate() { - if (IC2.platform.isSimulating() && this.addedToEnergyNet) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - this.addedToEnergyNet = false; - } - super.invalidate(); - } - - @Override - public List getNetworkedFields() { - List fields = new ArrayList(); - fields.add("facing"); - return fields; - } - - @Override - public void updateEntity() { - super.updateEntity(); - if (IC2.platform.isSimulating() && !this.addedToEnergyNet) { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - this.addedToEnergyNet = true; - } - - if (lastFacing != facing) { - IC2.network.get().updateTileEntityField(this, "facing"); - lastFacing = facing; - } - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing() != side; - } - - @Override - public short getFacing() { - return this.facing; - } - - @Override - public void setFacing(short facing1) { - if (IC2.platform.isSimulating() && this.addedToEnergyNet) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - this.addedToEnergyNet = false; - } - facing = (short) Math.max(2, facing1); - if (IC2.platform.isSimulating()) { - IC2.network.get().updateTileEntityField(this, "facing"); - lastFacing = facing; - } - if (IC2.platform.isSimulating() && !this.addedToEnergyNet) { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - this.addedToEnergyNet = true; - } - } - - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } - - @Override - public float getWrenchDropRate() { - return 1F; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("vulcanizationExtrudingMold"); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) { - super.readFromNBT(nbttagcompound); - this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); - facing = nbttagcompound.getShort("facing"); - energy = nbttagcompound.getDouble("energy"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) { - super.writeToNBT(nbttagcompound); - NBTTagCompound fluidTankTag = new NBTTagCompound(); - this.fluidTank.writeToNBT(fluidTankTag); - nbttagcompound.setTag("fluidTank", fluidTankTag); - nbttagcompound.setShort("facing", facing); - nbttagcompound.setDouble("energy", this.energy); - } - - @Override - public double getDemandedEnergy() { - return this.maxStorage - this.energy; - } - - @Override - public int getSinkTier() { - return 4; - } - - @Override - public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { - if (this.energy < this.maxStorage) { - this.energy += amount; - return 0.0D; - } else { - return amount; - } - } - - @Override - public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { - return true; - } - - private ItemStack processWire(ItemStack wire, boolean doProcess) { - UniversalRecipeOutput rOutput = VulcanizationExtrudingMoldTileEntity.recipeManager.getOutputFor( - Arrays.asList(new FluidStack[] { this.fluidTank.getFluid() }), Arrays.asList(new ItemStack[] { wire })); - if (rOutput == null || this.energy < this.energyConsume) { - return wire; - } - UniversalRecipeInput rInput = VulcanizationExtrudingMoldTileEntity.recipeManager.getRecipeInput( - Arrays.asList(new FluidStack[] { this.fluidTank.getFluid() }), Arrays.asList(new ItemStack[] { wire })); - ItemStack cableAsRO = rOutput.getItemOutputs().get(0).itemStack; - ItemStack cable = wire.copy(); - FlexibleCableItem fci = (FlexibleCableItem) cableAsRO.getItem(); - cable.stackTagCompound.setString("insulationMaterial", fci.getInsulationMaterial(cableAsRO)); - cable.stackTagCompound.setInteger("insulationThickness", fci.getInsulationThickness(cableAsRO)); - cable.stackTagCompound.setInteger("maxVoltage", IHLUtils - .getInsulationMaxVoltage(fci.getInsulationMaterial(cableAsRO), fci.getInsulationThickness(cableAsRO))); - if (doProcess) { - this.energy -= this.energyConsume; - this.fluidTank.drain(rInput.getFluidInputs().get(0).getAmount() * IHLUtils.getWireLength(cable), true); - } - return cable; - } - - @Override - public boolean canProcess(ItemStack wire) { - ItemStack cable = this.processWire(wire, false); - ForgeDirection dir = ForgeDirection.getOrientation(getFacing()).getRotation(ForgeDirection.UP); - TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); - if (te instanceof IProductionLine) { - if (ForgeDirection.getOrientation(((IProductionLine) te).getFacing()) - .equals(dir.getRotation(ForgeDirection.DOWN))) { - return ((IProductionLine) te).canProcess(cable); - } - } - return false; - } - - @Override - public void process(ItemStack wire) { - ItemStack cable = this.processWire(wire, true); - ForgeDirection dir = ForgeDirection.getOrientation(getFacing()).getRotation(ForgeDirection.UP); - TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); - if (te instanceof IProductionLine && ForgeDirection.getOrientation(((IProductionLine) te).getFacing()) - .equals(dir.getRotation(ForgeDirection.DOWN))) { - ((IProductionLine) te).process(cable); - } - } - - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return false; - } - - @Override - public boolean canFill(ForgeDirection arg0, Fluid arg1) { - return ForgeDirection.getOrientation(this.facing) == arg0; - } - - @Override - public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return null; - } - - @Override - public FluidStack drain(ForgeDirection arg0, int arg1, boolean arg2) { - return null; - } - - @Override - public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return this.fluidTank.fill(arg1, arg2); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { - return new FluidTankInfo[] {this.fluidTank.getInfo()}; - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } -} diff --git a/ihl/processing/metallurgy/WireMillContainer.java b/ihl/processing/metallurgy/WireMillContainer.java deleted file mode 100644 index 34f79de..0000000 --- a/ihl/processing/metallurgy/WireMillContainer.java +++ /dev/null @@ -1,113 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; - -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraftforge.fluids.FluidStack; - -public class WireMillContainer extends ContainerBase { - - public WireMillTileEntity tileEntity; - public int lastProgress = -1; - private short lastEnergy = -1; - public int lastFluidAmount = -1; - public int lastNumberOfFluids = -1; - public int lastFluidAmount2 = -1; - public int lastNumberOfFluids2 = -1; - public int lastFluidAmount3 = -1; - public int lastNumberOfFluids3 = -1; - private final static int height=166; - public List fluidTankFluidList; - public List fluidTankFluidList2; - public List fluidTankFluidList3; - - public WireMillContainer(EntityPlayer entityPlayer, - WireMillTileEntity lathePart1TileEntity) { - super(lathePart1TileEntity); - tileEntity=lathePart1TileEntity; - fluidTankFluidList = this.tileEntity.waterFluidTank.getFluidList(); - fluidTankFluidList2 = this.tileEntity.oilFluidTank.getFluidList(); - fluidTankFluidList3 = this.tileEntity.metalFluidTank.getFluidList(); - 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(tileEntity.dice, 0, 99+18, 31)); - 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.dischargeSlot,0, 8, 14)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - if (this.tileEntity.getEnergy() != this.lastEnergy) - { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); - } - - if (this.tileEntity.waterFluidTank.getFluidAmount() != this.lastFluidAmount || this.tileEntity.waterFluidTank.getNumberOfFluids() != this.lastNumberOfFluids) - { - IC2.network.get().sendContainerField(this, "fluidTankFluidList"); - } - - if (this.tileEntity.oilFluidTank.getFluidAmount() != this.lastFluidAmount2 || this.tileEntity.oilFluidTank.getNumberOfFluids() != this.lastNumberOfFluids2) - { - IC2.network.get().sendContainerField(this, "fluidTankFluidList2"); - } - - if (this.tileEntity.metalFluidTank.getFluidAmount() != this.lastFluidAmount3 || this.tileEntity.metalFluidTank.getNumberOfFluids() != this.lastNumberOfFluids3) - { - IC2.network.get().sendContainerField(this, "fluidTankFluidList3"); - } - } - this.lastNumberOfFluids = this.tileEntity.waterFluidTank.getNumberOfFluids(); - this.lastFluidAmount = this.tileEntity.waterFluidTank.getFluidAmount(); - this.lastNumberOfFluids2 = this.tileEntity.oilFluidTank.getNumberOfFluids(); - this.lastFluidAmount2 = this.tileEntity.oilFluidTank.getFluidAmount(); - this.lastNumberOfFluids3 = this.tileEntity.metalFluidTank.getNumberOfFluids(); - this.lastFluidAmount3 = this.tileEntity.metalFluidTank.getFluidAmount(); - this.lastProgress = this.tileEntity.progress; - this.lastEnergy = (short) this.tileEntity.getEnergy(); - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - case 1: - this.tileEntity.setEnergy(value); - break; - } - } - -} diff --git a/ihl/processing/metallurgy/WireMillGui.java b/ihl/processing/metallurgy/WireMillGui.java deleted file mode 100644 index 8a3d583..0000000 --- a/ihl/processing/metallurgy/WireMillGui.java +++ /dev/null @@ -1,68 +0,0 @@ -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; - -public class WireMillGui extends GuiContainer { - - private WireMillContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIWireMill.png"); - - public WireMillGui(WireMillContainer 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.getEnergy() > 0D) - { - 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.9F); - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(27, 15 + 12 - i1, 176, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) - { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); - this.drawTexturedModalRect(134, 33, 198, 0, i1 + 1, 13); - } - if (this.container.tileEntity.oilFluidTank.getFluid()!=null && this.container.tileEntity.oilFluidTank.getFluidAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.oilFluidTank, 81, 16, 93, 63, zLevel, par1, par2, xOffset, yOffset); - } - if (this.container.tileEntity.waterFluidTank.getFluid()!=null && this.container.tileEntity.waterFluidTank.getFluidAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.waterFluidTank, 64, 16, 76, 63, zLevel, par1, par2, xOffset, yOffset); - } - if (this.container.tileEntity.metalFluidTank.getFluid()!=null && this.container.tileEntity.metalFluidTank.getFluidAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.metalFluidTank, 98, 16, 110, 63, zLevel, par1, par2, xOffset, yOffset); - } - - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.wiremill.tip")); - } - - @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); - } -} diff --git a/ihl/processing/metallurgy/WireMillTileEntity.java b/ihl/processing/metallurgy/WireMillTileEntity.java deleted file mode 100644 index d93eb4f..0000000 --- a/ihl/processing/metallurgy/WireMillTileEntity.java +++ /dev/null @@ -1,378 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -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.InvSlot.Access; -import ic2.core.block.invslot.InvSlotConsumableLiquid; -import ic2.core.block.invslot.InvSlotOutput; -import ihl.IHLMod; -import ihl.items_blocks.IHLTool; -import ihl.processing.chemistry.ApparatusProcessableInvSlot; -import ihl.processing.invslots.InvSlotConsumableLiquidIHL; -import ihl.recipes.IRecipeInputFluid; -import ihl.recipes.RecipeInputDie; -import ihl.recipes.RecipeInputFluidDictionary; -import ihl.recipes.RecipeInputFluidStack; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLFluidTank; -import ihl.utils.IHLUtils; -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; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; - -public class WireMillTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler{ - - public final ApparatusProcessableInvSlot dice; - public final InvSlotConsumableLiquidIHL fillInputSlot; - public final InvSlotConsumableLiquidIHL drainInputSlot; - public final InvSlotOutput emptyFluidItemsSlot; - public final IHLFluidTank oilFluidTank = new IHLFluidTank(1100); - public final IHLFluidTank waterFluidTank = new IHLFluidTank(1100); - public final IHLFluidTank metalFluidTank = new IHLFluidTank(1100); - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("wiremill"); - protected static final UniversalRecipeManager recipeManagerMelting = new UniversalRecipeManager("wiremillMelting"); - - public WireMillTileEntity() - { - super(); - emptyFluidItemsSlot = new InvSlotOutput(this, "emptyWaterFluidItemsSlot", 2, 1); - 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.operationLength=600; - } - - - @Override - public String getInventoryName() { - return "WireMill"; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("wireMill"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) - { - return new WireMillGui(new WireMillContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) - { - return new WireMillContainer(player, this); - } - - @Override - public void operate() - { - UniversalRecipeInput rInput = WireMillTileEntity.recipeManager.getRecipeInput(getInput()); - IRecipeInput rInputDice = rInput.getItemInputs().get(0); - UniversalRecipeOutput rOutput = this.getOutput(); - ItemStack rOutputItemStack=null; - if(!rOutput.getItemOutputs().isEmpty()) - { - rOutputItemStack = rOutput.getItemOutputs().get(0).itemStack.copy(); - } - List rInputFluidStacks = rInput.getFluidInputs(); - int consumeMoltenMetalAmount=1; - if(!rInputFluidStacks.isEmpty() && rOutputItemStack!=null && rInputDice!=null && rInputDice instanceof RecipeInputDie) - { - if(rInputFluidStacks.size()>=3) - { - consumeMoltenMetalAmount=rInputFluidStacks.get(2).getAmount(); - } - else - { - consumeMoltenMetalAmount=rInputFluidStacks.get(0).getAmount(); - } - if(rOutputItemStack!=null && rInputDice!=null && rInputDice instanceof RecipeInputDie) - { - consumeMoltenMetalAmount*=((RecipeInputDie)rInputDice).transformOutput(this.dice.get(), rOutputItemStack); - } - } - if(dice.get()!=null) - { - if(dice.get().getItem() instanceof IHLTool) - { - IHLUtils.damageItemViaNBTTag(dice.get(), 1); - if(dice.get().stackSize<=0) - { - dice.put(null); - } - } - else - { - dice.consume(rInputDice); - } - } - if(this.drainInputSlot.get()!=null && !rInput.getItemInputs().isEmpty() && rInput.getItemInputs().get(0).matches(this.drainInputSlot.get())) - { - this.drainInputSlot.consume(1); - } - if(!rOutput.getFluidOutputs().isEmpty()) - { - this.metalFluidTank.fill(rOutput.getFluidOutputs().get(0), true); - } - 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) - { - if(!rInputFluidStacks.isEmpty()) - { - this.oilFluidTank.drain(1, true); - this.waterFluidTank.drain(1, true); - this.metalFluidTank.drain(consumeMoltenMetalAmount, true); - } - ((IProductionLine)te).process(rOutputItemStack); - } - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public List[] getInput() - { - return new List[]{Arrays.asList(new FluidStack[] {this.oilFluidTank.getFluid(),this.waterFluidTank.getFluid(),this.metalFluidTank.getFluid()}),Arrays.asList(new ItemStack[] {dice.get(),drainInputSlot.get()})}; - } - - public UniversalRecipeOutput getOutput() - { - return WireMillTileEntity.recipeManager.getOutputFor(this.getInput()); - } - - public static void addRecipe(FluidStack moltenMetal, IRecipeInput inputDice,ItemStack output1) - { - 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, (new IRecipeInput [] {new RecipeInputOreDict(string)})),new UniversalRecipeOutput((new FluidStack[] {fluidStack}),null,200)); - } - - - @Override - public boolean canOperate() - { - UniversalRecipeOutput output = this.getOutput(); - if(output!=null) - { - 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(te instanceof IProductionLine && !output.getItemOutputs().isEmpty()) - { - ItemStack isOut=this.getOutput().getItemOutputs().get(0).itemStack.copy(); - if(this.dice.get()!=null) - { - isOut.stackTagCompound.setInteger("transverseSection", this.dice.get().stackTagCompound.getInteger("transverseSection")); - } - return ForgeDirection.getOrientation(((IProductionLine)te).getFacing()).equals(dir) && ((IProductionLine)te).canProcess(isOut); - } - else if(!output.getFluidOutputs().isEmpty()) - { - FluidStack fstack = output.getFluidOutputs().get(0); - return metalFluidTank.fill(fstack, false)==fstack.amount; - } - } - return false; - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - this.oilFluidTank.readFromNBT(nbttagcompound.getCompoundTag("oilFluidTank")); - this.waterFluidTank.readFromNBT(nbttagcompound.getCompoundTag("waterFluidTank")); - this.metalFluidTank.readFromNBT(nbttagcompound.getCompoundTag("metalFluidTank")); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - NBTTagCompound oilFluidTankTag = new NBTTagCompound(); - this.oilFluidTank.writeToNBT(oilFluidTankTag); - nbttagcompound.setTag("oilFluidTank", oilFluidTankTag); - NBTTagCompound waterFluidTankTag = new NBTTagCompound(); - this.waterFluidTank.writeToNBT(waterFluidTankTag); - nbttagcompound.setTag("waterFluidTank", waterFluidTankTag); - NBTTagCompound metalFluidTankTag = new NBTTagCompound(); - this.metalFluidTank.writeToNBT(metalFluidTankTag); - nbttagcompound.setTag("metalFluidTank", metalFluidTankTag); - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - FluidStack drainSlotContent = drainInputSlot.drain(null, Integer.MAX_VALUE, null, true); - if(drainSlotContent!=null) - { - String fluidDictionaryName = IHLMod.fluidDictionary.getFluidName(drainSlotContent.getFluid()); - if(fluidDictionaryName!=null && fluidDictionaryName.equals("lubricant")) - { - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, oilFluidTank); - } - else if(fluidDictionaryName!=null && fluidDictionaryName.equals("water")) - { - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, waterFluidTank); - } - else - { - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, metalFluidTank); - } - } - else - { - if(metalFluidTank.getNumberOfFluids()>0) - { - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, metalFluidTank); - } - else if(oilFluidTank.getNumberOfFluids()>0) - { - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, oilFluidTank); - } - else - { - IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, waterFluidTank); - } - } - - } - public int gaugeLiquidScaled(int i) { - if(this.oilFluidTank.getFluid()!=null) - { - return this.oilFluidTank.getFluidAmount() * i /this.oilFluidTank.getCapacity(); - } - else - { - return 0; - } - } - - @Override - public int gaugeProgressScaled(int i) - { - return this.progress * i / this.operationLength; - } - - public int gaugeWaterScaled(int i) - { - if(this.waterFluidTank.getFluid()!=null) - { - return this.waterFluidTank.getFluidAmount() * i /this.waterFluidTank.getCapacity(); - } - else - { - return 0; - } - } - - public static Map getRecipes() - { - return recipeManager.getRecipes(); - } - - - @Override - public boolean canDrain(ForgeDirection arg0, Fluid arg1) { - return true; - } - - - @Override - public boolean canFill(ForgeDirection arg0, Fluid arg1) { - return true; - } - - - @Override - public FluidStack drain(ForgeDirection direction, FluidStack arg1, boolean arg2) - { - if(direction.equals(ForgeDirection.DOWN)) - { - return this.metalFluidTank.drain(arg1, arg2); - } - else if(direction.equals(ForgeDirection.UP)) - { - return this.waterFluidTank.drain(arg1, arg2); - } - else - { - return this.oilFluidTank.drain(arg1, arg2); - } - } - - - @Override - public FluidStack drain(ForgeDirection direction, int arg1, boolean arg2) - { - if(direction.equals(ForgeDirection.DOWN)) - { - return this.metalFluidTank.drain(arg1, arg2); - } - else if(direction.equals(ForgeDirection.UP)) - { - return this.waterFluidTank.drain(arg1, arg2); - } - else - { - return this.oilFluidTank.drain(arg1, arg2); - } - } - - - @Override - public int fill(ForgeDirection direction, FluidStack arg1, boolean arg2) - { - if(direction.equals(ForgeDirection.DOWN)) - { - return this.metalFluidTank.fill(arg1, arg2); - } - else if(direction.equals(ForgeDirection.UP)) - { - return this.waterFluidTank.fill(arg1, arg2); - } - else - { - return this.oilFluidTank.fill(arg1, arg2); - } - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection direction) - { - if(direction.equals(ForgeDirection.DOWN)) - { - return new FluidTankInfo[] {this.metalFluidTank.getInfo()}; - } - else if(direction.equals(ForgeDirection.UP)) - { - return new FluidTankInfo[] {this.waterFluidTank.getInfo()}; - } - else - { - return new FluidTankInfo[] {this.oilFluidTank.getInfo()}; - } - } -} diff --git a/ihl/processing/metallurgy/WoodenRollingMachineContainer.java b/ihl/processing/metallurgy/WoodenRollingMachineContainer.java deleted file mode 100644 index ba191f8..0000000 --- a/ihl/processing/metallurgy/WoodenRollingMachineContainer.java +++ /dev/null @@ -1,77 +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 WoodenRollingMachineContainer extends ContainerBase { - - public WoodenRollingMachinePart1TileEntity tileEntity; - public int lastProgress = -1; - private short lastEnergy = -1; - private final static int height=166; - - public WoodenRollingMachineContainer(EntityPlayer entityPlayer, - WoodenRollingMachinePart1TileEntity lathePart1TileEntity) { - super(lathePart1TileEntity); - tileEntity=lathePart1TileEntity; - 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(lathePart1TileEntity.output, 0, 54, 25)); - 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.dischargeSlot,0, 22, 55)); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - if (this.tileEntity.progress != this.lastProgress) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); - } - if (this.tileEntity.getEnergy() != this.lastEnergy) - { - icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); - } - } - this.lastProgress = this.tileEntity.progress; - this.lastEnergy = (short) this.tileEntity.getEnergy(); - } - - @Override - public void updateProgressBar(int index, int value) - { - super.updateProgressBar(index, value); - - switch (index) - { - case 0: - this.tileEntity.progress=(short) value; - break; - case 1: - this.tileEntity.setEnergy(value); - break; - } - } - -} diff --git a/ihl/processing/metallurgy/WoodenRollingMachineGui.java b/ihl/processing/metallurgy/WoodenRollingMachineGui.java deleted file mode 100644 index 085dae5..0000000 --- a/ihl/processing/metallurgy/WoodenRollingMachineGui.java +++ /dev/null @@ -1,60 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -public class WoodenRollingMachineGui extends GuiContainer { - - private WoodenRollingMachineContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIWoodenRollingMachine.png"); - - public WoodenRollingMachineGui(WoodenRollingMachineContainer latheContainer) { - super(latheContainer); - container = latheContainer; - } - - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(tex); - int i1; - if (this.container.tileEntity.getEnergy() > 0D) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - 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.progress > 0) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); - this.drawTexturedModalRect(18, 22, getFrameX(i1), getFrameY(i1),24,24); - } - } - - @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); - } - - private int getFrameY(int number) - { - return (number % 10) * 24 + 14; - } - - private int getFrameX(int number) - { - return (number / 10) * 24 + 176; - } -} diff --git a/ihl/processing/metallurgy/WoodenRollingMachinePart1Model.java b/ihl/processing/metallurgy/WoodenRollingMachinePart1Model.java deleted file mode 100644 index ac7799b..0000000 --- a/ihl/processing/metallurgy/WoodenRollingMachinePart1Model.java +++ /dev/null @@ -1,122 +0,0 @@ -// Date: 15.02.2015 11:28:39 -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package ihl.processing.metallurgy; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class WoodenRollingMachinePart1Model extends ModelBase -{ - //fields - IHLModelRenderer Base; - IHLModelRenderer RotatingPart2; - IHLModelRenderer MotorPart1; - IHLModelRenderer MotorPart2; - IHLModelRenderer RotatingPart1; - IHLModelRenderer RotatingPart3; - IHLModelRenderer RotatingPart4; - IHLModelRenderer Belt1; - IHLModelRenderer Belt2; - - public WoodenRollingMachinePart1Model() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 15); - setTextureOffset("Base.Shape16", 0, 23); - setTextureOffset("Base.PipeN18", 0, 0); - setTextureOffset("Base.PipeN19", 0, 0); - setTextureOffset("RotatingPart2.PipeN17", 0, 0); - setTextureOffset("RotatingPart2.PipeN21", 0, 0); - setTextureOffset("RotatingPart2.PipeN25", 0, 0); - setTextureOffset("MotorPart1.PipeN41", 0, 0); - setTextureOffset("MotorPart1.PipeN13", 0, 0); - setTextureOffset("MotorPart1.PipeN12", 0, 0); - setTextureOffset("MotorPart1.PipeN16", 0, 0); - setTextureOffset("MotorPart2.Shape4", 0, 24); - setTextureOffset("MotorPart2.Shape7", 0, 9); - setTextureOffset("MotorPart2.Shape10", 0, 9); - setTextureOffset("RotatingPart1.PipeN27", 0, 0); - setTextureOffset("RotatingPart1.PipN119", 0, 0); - setTextureOffset("RotatingPart1.pipeN24", 0, 0); - setTextureOffset("RotatingPart3.PipeN23", 0, 0); - setTextureOffset("RotatingPart3.PipeN22", 0, 0); - setTextureOffset("RotatingPart3.PipeN26", 0, 0); - setTextureOffset("RotatingPart4.PipeN28", 0, 0); - setTextureOffset("Belt1.Shape12", 60, 0); - setTextureOffset("Belt2.Shape17", 60, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); - Base.addBox("Shape16", -6F, -1F, -7F, 12, 8, 1); - Base.addTube("PipeN18", -5F, -6.1F, -7.1F, 10, 10, 1, 0.9F,1F,ForgeDirection.NORTH); - Base.addTube("PipeN19", -1.5F, -6F, -7F, 3, 3, 1, 0.25F,1F,ForgeDirection.NORTH);; - RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); - RotatingPart2.setRotationPoint(-2.2F, 16F, -8F); - setRotation(RotatingPart2, 0F, 0F, 0F); - RotatingPart2.mirror = true; - RotatingPart2.addTube("PipeN17", -2F, -2F, 2F, 4, 4, 28, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN21", -0.5F, -0.5F, 0F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart2.addTube("PipeN25", -0.5F, -0.5F, 30F, 1, 1, 2, 0F,1F,ForgeDirection.NORTH); - MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); - MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); - setRotation(MotorPart1, 0F, 0F, 0F); - MotorPart1.mirror = true; - MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); - MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); - MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); - MotorPart2.setRotationPoint(0F, 16F, 0F); - setRotation(MotorPart2, 0F, 0F, 0F); - MotorPart2.mirror = true; - MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); - MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); - MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); - RotatingPart1 = new IHLModelRenderer(this, "RotatingPart1"); - RotatingPart1.setRotationPoint(0F, 11.5F, -6F); - setRotation(RotatingPart1, 0F, 0F, 0F); - RotatingPart1.mirror = true; - RotatingPart1.addTube("PipeN27", -2F, -2F, 0F, 4, 4, 28, 0F,1F,ForgeDirection.NORTH); - RotatingPart1.addTube("PipN119", -0.5F, -0.5F, -2F, 1, 1, 2, 0F,1F,ForgeDirection.NORTH); - RotatingPart1.addTube("pipeN24", -0.5F, -0.5F, 28F, 1, 1, 2, 0F,1F,ForgeDirection.NORTH); - RotatingPart3 = new IHLModelRenderer(this, "RotatingPart3"); - RotatingPart3.setRotationPoint(2.2F, 16F, -8F); - setRotation(RotatingPart3, 0F, 0F, 0F); - RotatingPart3.mirror = true; - RotatingPart3.addTube("PipeN23", -2F, -2F, 2F, 4, 4, 28, 0F,1F,ForgeDirection.NORTH); - RotatingPart3.addTube("PipeN22", -1.5F, -1.5F, 0F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); - RotatingPart3.addTube("PipeN26", -0.5F, -0.5F, 30F, 1, 1, 2, 0F,1F,ForgeDirection.NORTH); - RotatingPart4 = new IHLModelRenderer(this, "RotatingPart4"); - RotatingPart4.setRotationPoint(0F, 15F, -5F); - setRotation(RotatingPart3, 0F, 0F, 0F); - RotatingPart4.mirror = true; - RotatingPart4.addTube("PipeN28", -0.5F, -0.5F, 0F, 1, 1, 27, 0F,1F,ForgeDirection.NORTH); - Belt1 = new IHLModelRenderer(this, "Belt1"); - Belt1.setRotationPoint(2.5F, 16F, -7.9F); - setRotation(Belt1, 0F, 0F, -0.45F); - Belt1.mirror = true; - Belt1.addBox("Shape12", 0F, 0F, 0F, 1, 5, 1); - Belt2 = new IHLModelRenderer(this, "Belt2"); - Belt2.setRotationPoint(2F, 16F, -7.9F); - setRotation(Belt2, 0F, 0F, -0.45F); - Belt2.mirror = true; - Belt2.addBox("Shape17", -1F, 0F, 0F, 1, 6, 1); - } - - - 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/WoodenRollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java deleted file mode 100644 index 857575a..0000000 --- a/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java +++ /dev/null @@ -1,158 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.List; -import java.util.Map; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.recipe.IRecipeInput; -import ic2.api.recipe.RecipeInputItemStack; -import ic2.api.recipe.RecipeInputOreDict; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.block.invslot.InvSlot.Access; -import ihl.processing.chemistry.ApparatusProcessableInvSlot; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.recipes.RecipeOutputItemStack; -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 net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ - - public final ApparatusProcessableInvSlot input; - public final IHLInvSlotOutput output; - public boolean assembled; - protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("woodenrollingmachine"); - - public WoodenRollingMachinePart1TileEntity() - { - super(); - input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 3, 64); - output = new IHLInvSlotOutput(this, "output", 2, 1); - } - - public UniversalRecipeOutput getOutput() - { - return WoodenRollingMachinePart1TileEntity.recipeManager.getOutputFor(this.getInput()); - } - - @Override - public List getNetworkedFields() - { - List fields = super.getNetworkedFields(); - fields.add("assembled"); - return fields; - } - - - @Override - public String getInventoryName() { - return "WoodenRollingMachine"; - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - if(assembled && !this.checkCorrectAccembly()) - { - assembled=false; - IC2.network.get().updateTileEntityField(this, "assembled"); - } - else if(!assembled && this.checkCorrectAccembly()) - { - assembled=true; - IC2.network.get().updateTileEntityField(this, "assembled"); - } - if (this.getActive() && this.progress == 0 && !this.canOperate()) - { - this.setActive(false); - } - - if (!this.getActive() && this.progress>0 && this.canOperate()) - { - this.setActive(true); - } - - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("woodenRollingMachinePart1"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new WoodenRollingMachineGui(new WoodenRollingMachineContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - return new WoodenRollingMachineContainer(player, this); - } - - @Override - public void operate() - { - List rInput = WoodenRollingMachinePart1TileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); - List rOutput = WoodenRollingMachinePart1TileEntity.recipeManager.getOutputFor(getInput()).getItemOutputs(); - this.output.add(rOutput); - for(int i=0;i getRecipes() { - return recipeManager.getRecipes(); - } - - public static void addRecipe(RecipeInputOreDict recipeInputOreDict, RecipeInputOreDict recipeInputOreDict2, ItemStack output) - { - recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] {recipeInputOreDict,recipeInputOreDict2})), new UniversalRecipeOutput(null,(new ItemStack[] {output}),20)); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - -} diff --git a/ihl/processing/metallurgy/WoodenRollingMachinePart2Model.java b/ihl/processing/metallurgy/WoodenRollingMachinePart2Model.java deleted file mode 100644 index 6ebc58e..0000000 --- a/ihl/processing/metallurgy/WoodenRollingMachinePart2Model.java +++ /dev/null @@ -1,44 +0,0 @@ -// Date: 15.02.2015 11:31:12 -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package ihl.processing.metallurgy; - -import ihl.model.IHLModelRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; - -public class WoodenRollingMachinePart2Model extends ModelBase -{ - //fields - IHLModelRenderer Base; - - public WoodenRollingMachinePart2Model() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("Base.Shape6", 0, 15); - setTextureOffset("Base.Shape16", 0, 23); - setTextureOffset("Base.PipeN18", 0, 0); - setTextureOffset("Base.PipeN19", 0, 0); - - Base = new IHLModelRenderer(this, "Base"); - Base.setRotationPoint(0F, 16F, 0F); - setRotation(Base, 0F, 0F, 0F); - Base.mirror = true; - Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); - Base.addBox("Shape16", -6F, -1F, 6F, 12, 8, 1); - Base.addTube("PipeN18", -5F, -6.1F, 6.1F, 10, 10, 1, 0.9F,1F,ForgeDirection.NORTH); - Base.addTube("PipeN19", -1.5F, -6F, 6F, 3, 3, 1, 0.25F,1F,ForgeDirection.NORTH);; - } - - 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/WoodenRollingMachinePart2TileEntity.java b/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java deleted file mode 100644 index 9aec41b..0000000 --- a/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java +++ /dev/null @@ -1,104 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.ArrayList; -import java.util.List; - -import ic2.api.network.INetworkDataProvider; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ihl.utils.IHLUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class WoodenRollingMachinePart2TileEntity extends TileEntity implements IWrenchable, INetworkDataProvider{ - - private short facing=2; - private short lastFacing=2; - - public WoodenRollingMachinePart2TileEntity() - { - super(); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public List getNetworkedFields() - { - List fields = new ArrayList(); - fields.add("facing"); - return fields; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if(lastFacing!=facing) - { - IC2.network.get().updateTileEntityField(this, "facing"); - lastFacing=facing; - } - } - - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return this.getFacing()!=side; - } - - - @Override - public short getFacing() { - return this.facing; - } - - - @Override - public void setFacing(short facing1) - { - facing=(short) Math.max(2,facing1); - if(IC2.platform.isSimulating()) - { - IC2.network.get().updateTileEntityField(this, "facing"); - } - } - - - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } - - - @Override - public float getWrenchDropRate() { - return 1F; - } - - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return IHLUtils.getThisModItemStack("woodenRollingMachinePart2"); - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - facing=nbttagcompound.getShort("facing"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - nbttagcompound.setShort("facing", facing); - } - -} diff --git a/ihl/processing/metallurgy/WoodenRollingMachineRender.java b/ihl/processing/metallurgy/WoodenRollingMachineRender.java deleted file mode 100644 index f180f75..0000000 --- a/ihl/processing/metallurgy/WoodenRollingMachineRender.java +++ /dev/null @@ -1,91 +0,0 @@ -package ihl.processing.metallurgy; -import org.lwjgl.opengl.GL11; - -import ic2.api.tile.IWrenchable; -import ihl.IHLModInfo; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -public class WoodenRollingMachineRender extends TileEntitySpecialRenderer{ -private WoodenRollingMachinePart1Model model = new WoodenRollingMachinePart1Model(); -private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/woodenRollingMachine.png"); -private final float scale=1F/16F; - - public WoodenRollingMachineRender() {} - - - @Override - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par8) - { - int rotation = 0; - if(tile.getWorldObj() != null) - { - switch (((IWrenchable)tile).getFacing()) - { - case 2: - rotation = 0; - break; - case 5: - rotation = 1; - break; - case 3: - rotation = 2; - break; - case 4: - rotation = 3; - break; - default: - rotation = 0; - } - } - else - { - return; - } - WoodenRollingMachinePart1TileEntity cte = (WoodenRollingMachinePart1TileEntity)tile; - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F); - - bindTexture(tex); - model.Base.render(scale); - if(cte.getActive()) - { - model.RotatingPart1.rotateAngleZ+=0.01F; - model.RotatingPart2.rotateAngleZ+=0.01F; - model.RotatingPart3.rotateAngleZ+=0.01F; - model.RotatingPart4.rotateAngleZ-=0.01F; - model.RotatingPart1.render(scale); - model.RotatingPart2.render(scale); - model.RotatingPart3.render(scale); - model.RotatingPart4.render(scale); - model.MotorPart1.rotateAngleZ-=0.03F; - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - model.Belt1.render(scale); - model.Belt2.render(scale); - } - else - { - model.RotatingPart1.rotateAngleZ=0.0F; - model.RotatingPart2.rotateAngleZ=0.0F; - model.RotatingPart3.rotateAngleZ=0.0F; - model.RotatingPart4.rotateAngleZ=0.0F; - if(cte.assembled) - { - model.RotatingPart1.render(scale); - model.RotatingPart2.render(scale); - model.RotatingPart3.render(scale); - model.RotatingPart4.render(scale); - } - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - model.Belt1.render(scale); - model.Belt2.render(scale); - } - GL11.glPopMatrix(); //end - - } -} \ No newline at end of file -- cgit v1.2.3