diff --git a/assets/hbm/textures/gui/gui_fwatz_multiblock.png b/assets/hbm/textures/gui/gui_fwatz_multiblock.png index 96a7bc15a..0dd24c77f 100644 Binary files a/assets/hbm/textures/gui/gui_fwatz_multiblock.png and b/assets/hbm/textures/gui/gui_fwatz_multiblock.png differ diff --git a/com/hbm/inventory/FluidTank.java b/com/hbm/inventory/FluidTank.java index 14e85dbaa..f5a63ef0e 100644 --- a/com/hbm/inventory/FluidTank.java +++ b/com/hbm/inventory/FluidTank.java @@ -3,7 +3,7 @@ package com.hbm.inventory; import java.util.Arrays; import com.hbm.handler.FluidTypeHandler.FluidType; -import com.hbm.inventory.gui.GuiFluidContainer; +import com.hbm.inventory.gui.GuiInfoContainer; import com.hbm.items.ModItems; import com.hbm.items.tool.ItemFluidIdentifier; import com.hbm.lib.RefStrings; @@ -154,11 +154,11 @@ public class FluidTank { } public void renderTankInfo(GuiContainer gui, int mouseX, int mouseY, int x, int y, int width, int height) { - if(gui instanceof GuiFluidContainer) - renderTankInfo((GuiFluidContainer)gui, mouseX, mouseY, x, y, width, height); + if(gui instanceof GuiInfoContainer) + renderTankInfo((GuiInfoContainer)gui, mouseX, mouseY, x, y, width, height); } - public void renderTankInfo(GuiFluidContainer gui, int mouseX, int mouseY, int x, int y, int width, int height) { + public void renderTankInfo(GuiInfoContainer gui, int mouseX, int mouseY, int x, int y, int width, int height) { if(x <= mouseX && x + width > mouseX && y < mouseY && y + height >= mouseY) gui.drawFluidInfo(new String[] { I18n.format(this.type.getUnlocalizedName()), fluid + "/" + maxFluid + "mB" }, mouseX, mouseY); } diff --git a/com/hbm/inventory/container/ContainerElectricFurnace.java b/com/hbm/inventory/container/ContainerElectricFurnace.java index c05111b05..8dc5c61fb 100644 --- a/com/hbm/inventory/container/ContainerElectricFurnace.java +++ b/com/hbm/inventory/container/ContainerElectricFurnace.java @@ -14,12 +14,10 @@ public class ContainerElectricFurnace extends Container { private TileEntityMachineElectricFurnace diFurnace; private int dualCookTime; - private int dualPower; private int lastItemBurnTime; public ContainerElectricFurnace(InventoryPlayer invPlayer, TileEntityMachineElectricFurnace tedf) { dualCookTime = 0; - dualPower = 0; lastItemBurnTime = 0; diFurnace = tedf; @@ -46,7 +44,6 @@ public class ContainerElectricFurnace extends Container { public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); crafting.sendProgressBarUpdate(this, 0, this.diFurnace.dualCookTime); - crafting.sendProgressBarUpdate(this, 1, this.diFurnace.power); } @Override @@ -102,15 +99,9 @@ public class ContainerElectricFurnace extends Container { { par1.sendProgressBarUpdate(this, 0, this.diFurnace.dualCookTime); } - - if(this.dualPower != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 1, this.diFurnace.power); - } } this.dualCookTime = this.diFurnace.dualCookTime; - this.dualPower = this.diFurnace.power; } @Override @@ -119,9 +110,5 @@ public class ContainerElectricFurnace extends Container { { diFurnace.dualCookTime = j; } - if(i == 1) - { - diFurnace.power = j; - } } } diff --git a/com/hbm/inventory/container/ContainerFWatzCore.java b/com/hbm/inventory/container/ContainerFWatzCore.java index 88b12f174..9b33d7ce0 100644 --- a/com/hbm/inventory/container/ContainerFWatzCore.java +++ b/com/hbm/inventory/container/ContainerFWatzCore.java @@ -13,12 +13,7 @@ public class ContainerFWatzCore extends Container { private TileEntityFWatzCore diFurnace; - private int cool; - private int power; - private int amat; - private int aSchrab; private boolean isRunning; - private int singularityType; public ContainerFWatzCore(InventoryPlayer invPlayer, TileEntityFWatzCore tedf) { @@ -27,8 +22,12 @@ public class ContainerFWatzCore extends Container { this.addSlotToContainer(new Slot(tedf, 0, 26, 108)); this.addSlotToContainer(new Slot(tedf, 1, 62, 90)); this.addSlotToContainer(new Slot(tedf, 2, 98, 90)); - this.addSlotToContainer(new Slot(tedf, 3, 134, 108)); - this.addSlotToContainer(new Slot(tedf, 4, 152, 108)); + //Inputs + this.addSlotToContainer(new Slot(tedf, 3, 134, 108 - 18)); + this.addSlotToContainer(new Slot(tedf, 4, 152, 108 - 18)); + //Outputs + this.addSlotToContainer(new Slot(tedf, 5, 134, 108)); + this.addSlotToContainer(new Slot(tedf, 6, 152, 108)); for(int i = 0; i < 3; i++) { @@ -47,12 +46,7 @@ public class ContainerFWatzCore extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.cool); - crafting.sendProgressBarUpdate(this, 1, this.diFurnace.power); - crafting.sendProgressBarUpdate(this, 2, this.diFurnace.amat); - crafting.sendProgressBarUpdate(this, 3, this.diFurnace.aSchrab); - crafting.sendProgressBarUpdate(this, 4, isRunning ? 1 : 0); - crafting.sendProgressBarUpdate(this, 5, singularityType); + crafting.sendProgressBarUpdate(this, 1, isRunning ? 1 : 0); } @Override @@ -66,8 +60,8 @@ public class ContainerFWatzCore extends Container { ItemStack var5 = var4.getStack(); var3 = var5.copy(); - if (par2 <= 4) { - if (!this.mergeItemStack(var5, 5, this.inventorySlots.size(), true)) + if (par2 <= 6) { + if (!this.mergeItemStack(var5, 7, this.inventorySlots.size(), true)) { return null; } @@ -101,64 +95,18 @@ public class ContainerFWatzCore extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.cool != this.diFurnace.cool) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.cool); - } - - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 1, this.diFurnace.power); - } - - if(this.amat != this.diFurnace.amat) - { - par1.sendProgressBarUpdate(this, 2, this.diFurnace.amat); - } - - if(this.aSchrab != this.diFurnace.aSchrab) - { - par1.sendProgressBarUpdate(this, 3, this.diFurnace.aSchrab); - } - if(this.isRunning != this.diFurnace.isRunning()) { - par1.sendProgressBarUpdate(this, 4, this.diFurnace.isRunning() ? 1 : 0); - } - - if(this.singularityType != this.diFurnace.getSingularityType()) - { - par1.sendProgressBarUpdate(this, 5, this.diFurnace.getSingularityType()); + par1.sendProgressBarUpdate(this, 1, this.diFurnace.isRunning() ? 1 : 0); } } - this.cool = this.diFurnace.cool; - this.power = this.diFurnace.power; - this.amat = this.diFurnace.amat; - this.aSchrab = this.diFurnace.aSchrab; this.isRunning = this.diFurnace.isRunning(); - this.singularityType = this.diFurnace.getSingularityType(); } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.cool = j; - } if(i == 1) - { - diFurnace.power = j; - } - if(i == 2) - { - diFurnace.amat = j; - } - if(i == 3) - { - diFurnace.aSchrab = j; - } - if(i == 4) { if(j == 0) { diff --git a/com/hbm/inventory/container/ContainerFusionMultiblock.java b/com/hbm/inventory/container/ContainerFusionMultiblock.java index 72a2c3539..013a577bb 100644 --- a/com/hbm/inventory/container/ContainerFusionMultiblock.java +++ b/com/hbm/inventory/container/ContainerFusionMultiblock.java @@ -13,10 +13,6 @@ public class ContainerFusionMultiblock extends Container { private TileEntityFusionMultiblock diFurnace; - private int water; - private int deut; - private int power; - private int trit; private boolean isRunning; public ContainerFusionMultiblock(InventoryPlayer invPlayer, TileEntityFusionMultiblock tedf) { @@ -61,7 +57,6 @@ public class ContainerFusionMultiblock extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); crafting.sendProgressBarUpdate(this, 1, isRunning ? 1 : 0); } @@ -111,27 +106,17 @@ public class ContainerFusionMultiblock extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - if(this.isRunning != this.diFurnace.isRunning()) { par1.sendProgressBarUpdate(this, 1, this.diFurnace.isRunning() ? 1 : 0); } } - this.power = this.diFurnace.power; this.isRunning = this.diFurnace.isRunning(); } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } if(i == 1) { if(j == 0) diff --git a/com/hbm/inventory/container/ContainerGenerator.java b/com/hbm/inventory/container/ContainerGenerator.java index c53670312..7500f8cab 100644 --- a/com/hbm/inventory/container/ContainerGenerator.java +++ b/com/hbm/inventory/container/ContainerGenerator.java @@ -14,7 +14,6 @@ public class ContainerGenerator extends Container { private TileEntityMachineGenerator diFurnace; - private int power; private int heat; public ContainerGenerator(InventoryPlayer invPlayer, TileEntityMachineGenerator tedf) { @@ -53,7 +52,6 @@ public class ContainerGenerator extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); crafting.sendProgressBarUpdate(this, 1, this.diFurnace.heat); } @@ -105,27 +103,17 @@ public class ContainerGenerator extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - if(this.heat != this.diFurnace.heat) { par1.sendProgressBarUpdate(this, 1, this.diFurnace.heat); } } - this.power = this.diFurnace.power; this.heat = this.diFurnace.heat; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } if(i == 1) { diFurnace.heat = j; diff --git a/com/hbm/inventory/container/ContainerIGenerator.java b/com/hbm/inventory/container/ContainerIGenerator.java index dd00c648f..12174b4b8 100644 --- a/com/hbm/inventory/container/ContainerIGenerator.java +++ b/com/hbm/inventory/container/ContainerIGenerator.java @@ -14,7 +14,6 @@ public class ContainerIGenerator extends Container { private TileEntityMachineIGenerator diFurnace; - private int power; private int torque; private int heat; private int water; @@ -65,7 +64,6 @@ public class ContainerIGenerator extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); crafting.sendProgressBarUpdate(this, 1, this.diFurnace.torque); crafting.sendProgressBarUpdate(this, 2, this.diFurnace.heat); crafting.sendProgressBarUpdate(this, 3, this.diFurnace.water); @@ -120,10 +118,6 @@ public class ContainerIGenerator extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } if(this.torque != this.diFurnace.torque) { par1.sendProgressBarUpdate(this, 1, this.diFurnace.torque); @@ -150,7 +144,6 @@ public class ContainerIGenerator extends Container { } } - this.power = this.diFurnace.power; this.torque = this.diFurnace.torque; this.heat = this.diFurnace.heat; this.water = this.diFurnace.water; @@ -161,10 +154,6 @@ public class ContainerIGenerator extends Container { @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } if(i == 1) { diFurnace.torque = j; diff --git a/com/hbm/inventory/container/ContainerLaunchPadTier1.java b/com/hbm/inventory/container/ContainerLaunchPadTier1.java index b8f41cb57..11a9190e1 100644 --- a/com/hbm/inventory/container/ContainerLaunchPadTier1.java +++ b/com/hbm/inventory/container/ContainerLaunchPadTier1.java @@ -12,10 +12,8 @@ import net.minecraft.item.ItemStack; public class ContainerLaunchPadTier1 extends Container { private TileEntityLaunchPad diFurnace; - private int power; public ContainerLaunchPadTier1(InventoryPlayer invPlayer, TileEntityLaunchPad tedf) { - power = 0; diFurnace = tedf; @@ -40,7 +38,6 @@ public class ContainerLaunchPadTier1 extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); } @Override @@ -80,29 +77,4 @@ public class ContainerLaunchPadTier1 extends Container { public boolean canInteractWith(EntityPlayer player) { return diFurnace.isUseableByPlayer(player); } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - - for(int i = 0; i < this.crafters.size(); i++) - { - ICrafting par1 = (ICrafting)this.crafters.get(i); - - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - } - - this.power = this.diFurnace.power; - } - - @Override - public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } - } } diff --git a/com/hbm/inventory/container/ContainerMachineAssembler.java b/com/hbm/inventory/container/ContainerMachineAssembler.java index c7773d272..6c49ebaae 100644 --- a/com/hbm/inventory/container/ContainerMachineAssembler.java +++ b/com/hbm/inventory/container/ContainerMachineAssembler.java @@ -14,7 +14,6 @@ public class ContainerMachineAssembler extends Container { private TileEntityMachineAssembler nukeBoy; - private int power; private int progress; private int maxProgress; @@ -107,11 +106,6 @@ private TileEntityMachineAssembler nukeBoy; { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.nukeBoy.power) - { - par1.sendProgressBarUpdate(this, 0, this.nukeBoy.power); - } - if(this.progress != this.nukeBoy.progress) { par1.sendProgressBarUpdate(this, 1, this.nukeBoy.progress); @@ -123,17 +117,12 @@ private TileEntityMachineAssembler nukeBoy; } } - this.power = this.nukeBoy.power; this.progress= this.nukeBoy.progress; this.maxProgress= this.nukeBoy.maxProgress; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - nukeBoy.power = j; - } if(i == 1) { nukeBoy.progress = j; diff --git a/com/hbm/inventory/container/ContainerMachineBattery.java b/com/hbm/inventory/container/ContainerMachineBattery.java index 6bd1a29ee..d3665eeba 100644 --- a/com/hbm/inventory/container/ContainerMachineBattery.java +++ b/com/hbm/inventory/container/ContainerMachineBattery.java @@ -12,10 +12,8 @@ import net.minecraft.item.ItemStack; public class ContainerMachineBattery extends Container { private TileEntityMachineBattery diFurnace; - private int power; public ContainerMachineBattery(InventoryPlayer invPlayer, TileEntityMachineBattery tedf) { - power = 0; diFurnace = tedf; @@ -39,7 +37,6 @@ public class ContainerMachineBattery extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); } @Override @@ -81,29 +78,4 @@ public class ContainerMachineBattery extends Container { public boolean canInteractWith(EntityPlayer player) { return diFurnace.isUseableByPlayer(player); } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - - for(int i = 0; i < this.crafters.size(); i++) - { - ICrafting par1 = (ICrafting)this.crafters.get(i); - - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - } - - this.power = this.diFurnace.power; - } - - @Override - public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } - } } diff --git a/com/hbm/inventory/container/ContainerMachineCMBFactory.java b/com/hbm/inventory/container/ContainerMachineCMBFactory.java index 2e59ca4e9..1a0e91fdb 100644 --- a/com/hbm/inventory/container/ContainerMachineCMBFactory.java +++ b/com/hbm/inventory/container/ContainerMachineCMBFactory.java @@ -13,11 +13,9 @@ import net.minecraft.item.ItemStack; public class ContainerMachineCMBFactory extends Container { private TileEntityMachineCMBFactory diFurnace; - private int power; private int progress; public ContainerMachineCMBFactory(InventoryPlayer invPlayer, TileEntityMachineCMBFactory tedf) { - power = 0; diFurnace = tedf; @@ -45,7 +43,6 @@ public class ContainerMachineCMBFactory extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); crafting.sendProgressBarUpdate(this, 1, this.diFurnace.process); } @@ -98,27 +95,17 @@ public class ContainerMachineCMBFactory extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - if(this.progress != this.diFurnace.process) { par1.sendProgressBarUpdate(this, 1, this.diFurnace.process); } } - this.power = this.diFurnace.power; this.progress = this.diFurnace.process; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } if(i == 1) { diFurnace.process = j; diff --git a/com/hbm/inventory/container/ContainerMachineChemplant.java b/com/hbm/inventory/container/ContainerMachineChemplant.java index dc27e4440..d31575cf3 100644 --- a/com/hbm/inventory/container/ContainerMachineChemplant.java +++ b/com/hbm/inventory/container/ContainerMachineChemplant.java @@ -15,7 +15,6 @@ public class ContainerMachineChemplant extends Container { private TileEntityMachineChemplant nukeBoy; - private int power; private int progress; private int maxProgress; @@ -115,11 +114,6 @@ private TileEntityMachineChemplant nukeBoy; { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.nukeBoy.power) - { - par1.sendProgressBarUpdate(this, 0, this.nukeBoy.power); - } - if(this.progress != this.nukeBoy.progress) { par1.sendProgressBarUpdate(this, 1, this.nukeBoy.progress); @@ -131,17 +125,12 @@ private TileEntityMachineChemplant nukeBoy; } } - this.power = this.nukeBoy.power; this.progress= this.nukeBoy.progress; this.maxProgress= this.nukeBoy.maxProgress; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - nukeBoy.power = j; - } if(i == 1) { nukeBoy.progress = j; diff --git a/com/hbm/inventory/container/ContainerMachineCoal.java b/com/hbm/inventory/container/ContainerMachineCoal.java index abef85a8c..2df372592 100644 --- a/com/hbm/inventory/container/ContainerMachineCoal.java +++ b/com/hbm/inventory/container/ContainerMachineCoal.java @@ -13,11 +13,9 @@ import net.minecraft.item.ItemStack; public class ContainerMachineCoal extends Container { private TileEntityMachineCoal diFurnace; - private int power; private int burnTime; public ContainerMachineCoal(InventoryPlayer invPlayer, TileEntityMachineCoal tedf) { - power = 0; burnTime = 0; diFurnace = tedf; @@ -44,8 +42,7 @@ public class ContainerMachineCoal extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); - crafting.sendProgressBarUpdate(this, 1, this.diFurnace.burnTime); + crafting.sendProgressBarUpdate(this, 0, this.diFurnace.burnTime); } @Override @@ -98,28 +95,18 @@ public class ContainerMachineCoal extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.diFurnace.power) + if(this.burnTime != this.diFurnace.burnTime) { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - - if(this.power != this.diFurnace.burnTime) - { - par1.sendProgressBarUpdate(this, 1, this.diFurnace.burnTime); + par1.sendProgressBarUpdate(this, 0, this.diFurnace.burnTime); } } - this.power = this.diFurnace.power; this.burnTime = this.diFurnace.burnTime; } @Override public void updateProgressBar(int i, int j) { if(i == 0) - { - diFurnace.power = j; - } - if(i == 1) { diFurnace.burnTime = j; } diff --git a/com/hbm/inventory/container/ContainerMachineCyclotron.java b/com/hbm/inventory/container/ContainerMachineCyclotron.java index a6e8d532e..dde7cce44 100644 --- a/com/hbm/inventory/container/ContainerMachineCyclotron.java +++ b/com/hbm/inventory/container/ContainerMachineCyclotron.java @@ -14,11 +14,9 @@ public class ContainerMachineCyclotron extends Container { private TileEntityMachineCyclotron testNuke; private int progress; - private int power; public ContainerMachineCyclotron(InventoryPlayer invPlayer, TileEntityMachineCyclotron tedf) { progress = 0; - power = 0; testNuke = tedf; @@ -63,7 +61,6 @@ public class ContainerMachineCyclotron extends Container { public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); crafting.sendProgressBarUpdate(this, 0, this.testNuke.progress); - crafting.sendProgressBarUpdate(this, 1, this.testNuke.power); } @Override @@ -118,14 +115,9 @@ public class ContainerMachineCyclotron extends Container { { par1.sendProgressBarUpdate(this, 0, this.testNuke.progress); } - if(this.power != this.testNuke.power) - { - par1.sendProgressBarUpdate(this, 1, this.testNuke.power); - } } this.progress = this.testNuke.progress; - this.power = this.testNuke.power; } @Override @@ -134,9 +126,5 @@ public class ContainerMachineCyclotron extends Container { { testNuke.progress = j; } - if(i == 1) - { - testNuke.power = j; - } } } diff --git a/com/hbm/inventory/container/ContainerMachineDiesel.java b/com/hbm/inventory/container/ContainerMachineDiesel.java index d18e86bc3..0306bcca9 100644 --- a/com/hbm/inventory/container/ContainerMachineDiesel.java +++ b/com/hbm/inventory/container/ContainerMachineDiesel.java @@ -13,10 +13,8 @@ import net.minecraft.item.ItemStack; public class ContainerMachineDiesel extends Container { private TileEntityMachineDiesel diFurnace; - private int power; public ContainerMachineDiesel(InventoryPlayer invPlayer, TileEntityMachineDiesel tedf) { - power = 0; diFurnace = tedf; @@ -43,7 +41,6 @@ public class ContainerMachineDiesel extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); } @Override @@ -87,29 +84,4 @@ public class ContainerMachineDiesel extends Container { public boolean canInteractWith(EntityPlayer player) { return diFurnace.isUseableByPlayer(player); } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - - for(int i = 0; i < this.crafters.size(); i++) - { - ICrafting par1 = (ICrafting)this.crafters.get(i); - - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - } - - this.power = this.diFurnace.power; - } - - @Override - public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } - } } diff --git a/com/hbm/inventory/container/ContainerMachineGasFlare.java b/com/hbm/inventory/container/ContainerMachineGasFlare.java index d5838a380..ad74f2ba3 100644 --- a/com/hbm/inventory/container/ContainerMachineGasFlare.java +++ b/com/hbm/inventory/container/ContainerMachineGasFlare.java @@ -13,10 +13,8 @@ import net.minecraft.item.ItemStack; public class ContainerMachineGasFlare extends Container { private TileEntityMachineGasFlare testNuke; - private int power; public ContainerMachineGasFlare(InventoryPlayer invPlayer, TileEntityMachineGasFlare tedf) { - power = 0; testNuke = tedf; @@ -83,29 +81,4 @@ public class ContainerMachineGasFlare extends Container { public boolean canInteractWith(EntityPlayer player) { return testNuke.isUseableByPlayer(player); } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - - for(int i = 0; i < this.crafters.size(); i++) - { - ICrafting par1 = (ICrafting)this.crafters.get(i); - - if(this.power != this.testNuke.power) - { - par1.sendProgressBarUpdate(this, 0, this.testNuke.power); - } - } - - this.power = this.testNuke.power; - } - - @Override - public void updateProgressBar(int i, int j) { - if(i == 0) - { - testNuke.power = j; - } - } } diff --git a/com/hbm/inventory/container/ContainerMachineMiningDrill.java b/com/hbm/inventory/container/ContainerMachineMiningDrill.java index 06ef5c837..05a593986 100644 --- a/com/hbm/inventory/container/ContainerMachineMiningDrill.java +++ b/com/hbm/inventory/container/ContainerMachineMiningDrill.java @@ -13,7 +13,6 @@ public class ContainerMachineMiningDrill extends Container { private TileEntityMachineMiningDrill nukeBoy; - private int power; private int warning; public ContainerMachineMiningDrill(InventoryPlayer invPlayer, TileEntityMachineMiningDrill tedf) { @@ -99,26 +98,17 @@ private TileEntityMachineMiningDrill nukeBoy; { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.nukeBoy.power) - { - par1.sendProgressBarUpdate(this, 0, this.nukeBoy.power); - } if(this.warning != this.nukeBoy.warning) { par1.sendProgressBarUpdate(this, 1, this.nukeBoy.warning); } } - this.power = this.nukeBoy.power; this.warning = this.nukeBoy.warning; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - nukeBoy.power = j; - } if(i == 1) { nukeBoy.warning = j; diff --git a/com/hbm/inventory/container/ContainerMachineOilWell.java b/com/hbm/inventory/container/ContainerMachineOilWell.java index 83fae02a1..9af1ec1a5 100644 --- a/com/hbm/inventory/container/ContainerMachineOilWell.java +++ b/com/hbm/inventory/container/ContainerMachineOilWell.java @@ -13,12 +13,10 @@ import net.minecraft.item.ItemStack; public class ContainerMachineOilWell extends Container { private TileEntityMachineOilWell testNuke; - private int power; private int warning; private int warning2; public ContainerMachineOilWell(InventoryPlayer invPlayer, TileEntityMachineOilWell tedf) { - power = 0; warning = 0; warning2 = 0; @@ -54,7 +52,6 @@ public class ContainerMachineOilWell extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.testNuke.power); crafting.sendProgressBarUpdate(this, 1, this.testNuke.warning); crafting.sendProgressBarUpdate(this, 2, this.testNuke.warning2); } @@ -108,10 +105,6 @@ public class ContainerMachineOilWell extends Container { for(int i = 0; i < this.crafters.size(); i++) { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.testNuke.power) - { - par1.sendProgressBarUpdate(this, 0, this.testNuke.power); - } if(this.warning != this.testNuke.warning) { par1.sendProgressBarUpdate(this, 1, this.testNuke.warning); @@ -122,17 +115,12 @@ public class ContainerMachineOilWell extends Container { } } - this.power = this.testNuke.power; this.warning = this.testNuke.warning; this.warning2 = this.testNuke.warning2; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - testNuke.power = j; - } if(i == 1) { testNuke.warning = j; diff --git a/com/hbm/inventory/container/ContainerMachinePumpjack.java b/com/hbm/inventory/container/ContainerMachinePumpjack.java index 23988cc5b..9c281b65e 100644 --- a/com/hbm/inventory/container/ContainerMachinePumpjack.java +++ b/com/hbm/inventory/container/ContainerMachinePumpjack.java @@ -14,12 +14,10 @@ import net.minecraft.item.ItemStack; public class ContainerMachinePumpjack extends Container { private TileEntityMachinePumpjack testNuke; - private int power; private int warning; private int warning2; public ContainerMachinePumpjack(InventoryPlayer invPlayer, TileEntityMachinePumpjack tedf) { - power = 0; warning = 0; warning2 = 0; @@ -55,7 +53,6 @@ public class ContainerMachinePumpjack extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.testNuke.power); crafting.sendProgressBarUpdate(this, 1, this.testNuke.warning); crafting.sendProgressBarUpdate(this, 2, this.testNuke.warning2); } @@ -109,10 +106,6 @@ public class ContainerMachinePumpjack extends Container { for(int i = 0; i < this.crafters.size(); i++) { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.testNuke.power) - { - par1.sendProgressBarUpdate(this, 0, this.testNuke.power); - } if(this.warning != this.testNuke.warning) { par1.sendProgressBarUpdate(this, 1, this.testNuke.warning); @@ -123,17 +116,12 @@ public class ContainerMachinePumpjack extends Container { } } - this.power = this.testNuke.power; this.warning = this.testNuke.warning; this.warning2 = this.testNuke.warning2; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - testNuke.power = j; - } if(i == 1) { testNuke.warning = j; diff --git a/com/hbm/inventory/container/ContainerMachineRTG.java b/com/hbm/inventory/container/ContainerMachineRTG.java index 1ba3d04b5..07e1f070e 100644 --- a/com/hbm/inventory/container/ContainerMachineRTG.java +++ b/com/hbm/inventory/container/ContainerMachineRTG.java @@ -13,11 +13,9 @@ public class ContainerMachineRTG extends Container { private TileEntityMachineRTG testNuke; private int heat; - private int power; public ContainerMachineRTG(InventoryPlayer invPlayer, TileEntityMachineRTG tedf) { heat = 0; - power = 0; testNuke = tedf; @@ -55,7 +53,6 @@ public class ContainerMachineRTG extends Container { public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); crafting.sendProgressBarUpdate(this, 0, this.testNuke.heat); - crafting.sendProgressBarUpdate(this, 1, this.testNuke.power); } @Override @@ -110,14 +107,9 @@ public class ContainerMachineRTG extends Container { { par1.sendProgressBarUpdate(this, 0, this.testNuke.heat); } - if(this.power != this.testNuke.power) - { - par1.sendProgressBarUpdate(this, 1, this.testNuke.power); - } } this.heat = this.testNuke.heat; - this.power = this.testNuke.power; } @Override @@ -126,9 +118,5 @@ public class ContainerMachineRTG extends Container { { testNuke.heat = j; } - if(i == 1) - { - testNuke.power = j; - } } } diff --git a/com/hbm/inventory/container/ContainerMachineRefinery.java b/com/hbm/inventory/container/ContainerMachineRefinery.java index e6c6a7ad0..6452f2038 100644 --- a/com/hbm/inventory/container/ContainerMachineRefinery.java +++ b/com/hbm/inventory/container/ContainerMachineRefinery.java @@ -13,10 +13,8 @@ import net.minecraft.item.ItemStack; public class ContainerMachineRefinery extends Container { private TileEntityMachineRefinery testNuke; - private int power; public ContainerMachineRefinery(InventoryPlayer invPlayer, TileEntityMachineRefinery tedf) { - power = 0; testNuke = tedf; @@ -108,29 +106,4 @@ public class ContainerMachineRefinery extends Container { public boolean canInteractWith(EntityPlayer player) { return testNuke.isUseableByPlayer(player); } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - - for(int i = 0; i < this.crafters.size(); i++) - { - ICrafting par1 = (ICrafting)this.crafters.get(i); - - if(this.power != this.testNuke.power) - { - par1.sendProgressBarUpdate(this, 0, this.testNuke.power); - } - } - - this.power = this.testNuke.power; - } - - @Override - public void updateProgressBar(int i, int j) { - if(i == 0) - { - testNuke.power = j; - } - } } diff --git a/com/hbm/inventory/container/ContainerMachineSchrabidiumTransmutator.java b/com/hbm/inventory/container/ContainerMachineSchrabidiumTransmutator.java index d67ba5f31..4edf5e28c 100644 --- a/com/hbm/inventory/container/ContainerMachineSchrabidiumTransmutator.java +++ b/com/hbm/inventory/container/ContainerMachineSchrabidiumTransmutator.java @@ -14,7 +14,6 @@ public class ContainerMachineSchrabidiumTransmutator extends Container { private TileEntityMachineSchrabidiumTransmutator nukeBoy; - private int power; private int water; private int sulfur; private int progress; @@ -92,27 +91,17 @@ private TileEntityMachineSchrabidiumTransmutator nukeBoy; { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.nukeBoy.process) + if(this.progress != this.nukeBoy.process) { par1.sendProgressBarUpdate(this, 0, this.nukeBoy.process); } - - if(this.power != this.nukeBoy.power) - { - par1.sendProgressBarUpdate(this, 1, this.nukeBoy.power); - } } - this.power = this.nukeBoy.power; this.progress = this.nukeBoy.process; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - nukeBoy.process = j; - } if(i == 1) { nukeBoy.power = j; diff --git a/com/hbm/inventory/container/ContainerMachineShredder.java b/com/hbm/inventory/container/ContainerMachineShredder.java index 284375dcd..a307833c0 100644 --- a/com/hbm/inventory/container/ContainerMachineShredder.java +++ b/com/hbm/inventory/container/ContainerMachineShredder.java @@ -13,11 +13,9 @@ import net.minecraft.item.ItemStack; public class ContainerMachineShredder extends Container { private TileEntityMachineShredder diFurnace; - private int power; private int progress; public ContainerMachineShredder(InventoryPlayer invPlayer, TileEntityMachineShredder tedf) { - power = 0; diFurnace = tedf; @@ -69,7 +67,6 @@ public class ContainerMachineShredder extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); crafting.sendProgressBarUpdate(this, 1, this.diFurnace.progress); } @@ -123,27 +120,17 @@ public class ContainerMachineShredder extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - if(this.progress != this.diFurnace.progress) { par1.sendProgressBarUpdate(this, 1, this.diFurnace.progress); } } - this.power = this.diFurnace.power; this.progress = this.diFurnace.progress; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } if(i == 1) { diFurnace.progress = j; diff --git a/com/hbm/inventory/container/ContainerMachineTeleporter.java b/com/hbm/inventory/container/ContainerMachineTeleporter.java index 000879545..d4c30c0fd 100644 --- a/com/hbm/inventory/container/ContainerMachineTeleporter.java +++ b/com/hbm/inventory/container/ContainerMachineTeleporter.java @@ -12,7 +12,6 @@ public class ContainerMachineTeleporter extends Container { private TileEntityMachineTeleporter diFurnace; - private int power; private int x; private int y; private int z; @@ -25,7 +24,6 @@ public class ContainerMachineTeleporter extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); crafting.sendProgressBarUpdate(this, 1, this.diFurnace.targetX); crafting.sendProgressBarUpdate(this, 2, this.diFurnace.targetY); crafting.sendProgressBarUpdate(this, 3, this.diFurnace.targetZ); @@ -50,10 +48,6 @@ public class ContainerMachineTeleporter extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } if(this.x != this.diFurnace.targetX) { par1.sendProgressBarUpdate(this, 1, this.diFurnace.targetX); @@ -68,7 +62,6 @@ public class ContainerMachineTeleporter extends Container { } } - this.power = this.diFurnace.power; this.x = this.diFurnace.targetX; this.y = this.diFurnace.targetY; this.z = this.diFurnace.targetZ; @@ -76,10 +69,6 @@ public class ContainerMachineTeleporter extends Container { @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } if(i == 1) { diFurnace.targetX = j; diff --git a/com/hbm/inventory/container/ContainerMachineTurbofan.java b/com/hbm/inventory/container/ContainerMachineTurbofan.java index 173f7d1ec..10cac1af2 100644 --- a/com/hbm/inventory/container/ContainerMachineTurbofan.java +++ b/com/hbm/inventory/container/ContainerMachineTurbofan.java @@ -14,11 +14,9 @@ import net.minecraft.item.ItemStack; public class ContainerMachineTurbofan extends Container { private TileEntityMachineTurbofan diFurnace; - private int power; private int afterburner; public ContainerMachineTurbofan(InventoryPlayer invPlayer, TileEntityMachineTurbofan tedf) { - power = 0; afterburner = 0; diFurnace = tedf; @@ -44,7 +42,6 @@ public class ContainerMachineTurbofan extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); crafting.sendProgressBarUpdate(this, 1, this.diFurnace.afterburner); } @@ -97,25 +94,17 @@ public class ContainerMachineTurbofan extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } if(this.afterburner != this.diFurnace.afterburner) { par1.sendProgressBarUpdate(this, 1, this.diFurnace.afterburner); } } - this.power = this.diFurnace.power; + this.afterburner = this.diFurnace.afterburner; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } if(i == 1) { diFurnace.afterburner = j; diff --git a/com/hbm/inventory/container/ContainerReactorMultiblock.java b/com/hbm/inventory/container/ContainerReactorMultiblock.java index 2c35f5922..3be08e640 100644 --- a/com/hbm/inventory/container/ContainerReactorMultiblock.java +++ b/com/hbm/inventory/container/ContainerReactorMultiblock.java @@ -13,7 +13,6 @@ public class ContainerReactorMultiblock extends Container { private TileEntityReactorMultiblock diFurnace; - private int power; private int heat; public ContainerReactorMultiblock(InventoryPlayer invPlayer, TileEntityReactorMultiblock tedf) { @@ -80,7 +79,6 @@ public class ContainerReactorMultiblock extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); crafting.sendProgressBarUpdate(this, 1, this.diFurnace.heat); } @@ -130,28 +128,17 @@ public class ContainerReactorMultiblock extends Container { { ICrafting par1 = (ICrafting)this.crafters.get(i); - - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - if(this.heat != this.diFurnace.heat) { par1.sendProgressBarUpdate(this, 1, this.diFurnace.heat); } } - this.power = this.diFurnace.power; this.heat = this.diFurnace.heat; } @Override public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } if(i == 1) { diFurnace.heat = j; diff --git a/com/hbm/inventory/container/ContainerWatzCore.java b/com/hbm/inventory/container/ContainerWatzCore.java index c8b02b34c..e75906f24 100644 --- a/com/hbm/inventory/container/ContainerWatzCore.java +++ b/com/hbm/inventory/container/ContainerWatzCore.java @@ -13,8 +13,6 @@ public class ContainerWatzCore extends Container { private TileEntityWatzCore diFurnace; - private int power; - public ContainerWatzCore(InventoryPlayer invPlayer, TileEntityWatzCore tedf) { diFurnace = tedf; @@ -81,7 +79,6 @@ public class ContainerWatzCore extends Container { @Override public void addCraftingToCrafters(ICrafting crafting) { super.addCraftingToCrafters(crafting); - crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power); } @Override @@ -121,29 +118,4 @@ public class ContainerWatzCore extends Container { public boolean canInteractWith(EntityPlayer player) { return diFurnace.isUseableByPlayer(player); } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - - for(int i = 0; i < this.crafters.size(); i++) - { - ICrafting par1 = (ICrafting)this.crafters.get(i); - - if(this.power != this.diFurnace.power) - { - par1.sendProgressBarUpdate(this, 0, this.diFurnace.power); - } - } - - this.power = this.diFurnace.power; - } - - @Override - public void updateProgressBar(int i, int j) { - if(i == 0) - { - diFurnace.power = j; - } - } } diff --git a/com/hbm/inventory/gui/GUIFWatzCore.java b/com/hbm/inventory/gui/GUIFWatzCore.java index 39e43cbed..bc18f0888 100644 --- a/com/hbm/inventory/gui/GUIFWatzCore.java +++ b/com/hbm/inventory/gui/GUIFWatzCore.java @@ -2,6 +2,7 @@ package com.hbm.inventory.gui; import org.lwjgl.opengl.GL11; +import com.hbm.inventory.FluidTank; import com.hbm.inventory.container.ContainerFWatzCore; import com.hbm.lib.RefStrings; import com.hbm.tileentity.machine.TileEntityFWatzCore; @@ -12,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIFWatzCore extends GuiContainer { +public class GUIFWatzCore extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_fwatz_multiblock.png"); private TileEntityFWatzCore diFurnace; @@ -25,6 +26,15 @@ public class GUIFWatzCore extends GuiContainer { this.ySize = 222; } + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + diFurnace.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 88 - 70, 16, 70); + diFurnace.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 88 - 70, 16, 70); + diFurnace.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 88 - 70, 16, 70); + } + @Override protected void drawGuiContainerForegroundLayer(int i, int j) { String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName()); @@ -39,22 +49,19 @@ public class GUIFWatzCore extends GuiContainer { Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - int i = diFurnace.getWaterScaled(88); - drawTexturedModalRect(guiLeft + 134, guiTop + 106 - i, 208, 88 - i, 16, i); - - int j = diFurnace.getCoolantScaled(88); - drawTexturedModalRect(guiLeft + 8, guiTop + 106 - j, 176, 88 - j, 16, j); - int k = diFurnace.getPowerScaled(88); drawTexturedModalRect(guiLeft + 26, guiTop + 106 - k, 192, 88 - k, 16, k); - - int l = diFurnace.getHeatScaled(88); - drawTexturedModalRect(guiLeft + 152, guiTop + 106 - l, 224, 88 - l, 16, l); if(diFurnace.isRunning()) drawTexturedModalRect(guiLeft + 64, guiTop + 29, 176, 88, 48, 48); int m = diFurnace.getSingularityType(); drawTexturedModalRect(guiLeft + 98, guiTop + 109, 240, 4 * m, 16, 4); + + Minecraft.getMinecraft().getTextureManager().bindTexture(FluidTank.fluidTextures); + + diFurnace.tanks[0].renderTank(this, guiLeft + 8, guiTop + 88, diFurnace.tanks[0].getTankType().textureX() * FluidTank.x, diFurnace.tanks[0].getTankType().textureY() * FluidTank.y, 16, 70); + diFurnace.tanks[1].renderTank(this, guiLeft + 134, guiTop + 88, diFurnace.tanks[1].getTankType().textureX() * FluidTank.x, diFurnace.tanks[1].getTankType().textureY() * FluidTank.y, 16, 70); + diFurnace.tanks[2].renderTank(this, guiLeft + 152, guiTop + 88, diFurnace.tanks[2].getTankType().textureX() * FluidTank.x, diFurnace.tanks[2].getTankType().textureY() * FluidTank.y, 16, 70); } } diff --git a/com/hbm/inventory/gui/GUIFusionMultiblock.java b/com/hbm/inventory/gui/GUIFusionMultiblock.java index 581a6f01d..5cfecfb90 100644 --- a/com/hbm/inventory/gui/GUIFusionMultiblock.java +++ b/com/hbm/inventory/gui/GUIFusionMultiblock.java @@ -13,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIFusionMultiblock extends GuiFluidContainer { +public class GUIFusionMultiblock extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_fusion_multiblock.png"); private TileEntityFusionMultiblock diFurnace; diff --git a/com/hbm/inventory/gui/GUIIGenerator.java b/com/hbm/inventory/gui/GUIIGenerator.java index 26b149544..70fd8c627 100644 --- a/com/hbm/inventory/gui/GUIIGenerator.java +++ b/com/hbm/inventory/gui/GUIIGenerator.java @@ -12,7 +12,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIIGenerator extends GuiContainer { +public class GUIIGenerator extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_igenerator.png"); private TileEntityMachineIGenerator diFurnace; @@ -25,6 +25,13 @@ public class GUIIGenerator extends GuiContainer { this.ySize = 222; } + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 106 - 88, 16, 88, diFurnace.power, diFurnace.maxPower); + } + @Override protected void drawGuiContainerForegroundLayer(int i, int j) { String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName()); diff --git a/com/hbm/inventory/gui/GUIMachineAssembler.java b/com/hbm/inventory/gui/GUIMachineAssembler.java index 44b8c5c60..64fa8d44b 100644 --- a/com/hbm/inventory/gui/GUIMachineAssembler.java +++ b/com/hbm/inventory/gui/GUIMachineAssembler.java @@ -12,7 +12,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineAssembler extends GuiContainer { +public class GUIMachineAssembler extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_assembler.png"); private TileEntityMachineAssembler assembler; @@ -24,6 +24,13 @@ public class GUIMachineAssembler extends GuiContainer { this.xSize = 176; this.ySize = 222; } + + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 116, guiTop + 70 - 52, 16, 52, assembler.power, assembler.maxPower); + } @Override protected void drawGuiContainerForegroundLayer( int i, int j) { diff --git a/com/hbm/inventory/gui/GUIMachineBattery.java b/com/hbm/inventory/gui/GUIMachineBattery.java index 02981036c..21ae888de 100644 --- a/com/hbm/inventory/gui/GUIMachineBattery.java +++ b/com/hbm/inventory/gui/GUIMachineBattery.java @@ -12,7 +12,7 @@ import com.hbm.inventory.container.ContainerMachineBattery; import com.hbm.lib.RefStrings; import com.hbm.tileentity.machine.TileEntityMachineBattery; -public class GUIMachineBattery extends GuiContainer { +public class GUIMachineBattery extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_battery.png"); private TileEntityMachineBattery diFurnace; @@ -25,6 +25,13 @@ public class GUIMachineBattery extends GuiContainer { this.ySize = 166; } + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 69 - 52, 52, 52, diFurnace.power, diFurnace.maxPower); + } + @Override protected void drawGuiContainerForegroundLayer(int i, int j) { String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName()); diff --git a/com/hbm/inventory/gui/GUIMachineCMBFactory.java b/com/hbm/inventory/gui/GUIMachineCMBFactory.java index 7aee0c75d..cbe60463e 100644 --- a/com/hbm/inventory/gui/GUIMachineCMBFactory.java +++ b/com/hbm/inventory/gui/GUIMachineCMBFactory.java @@ -13,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineCMBFactory extends GuiFluidContainer { +public class GUIMachineCMBFactory extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_cmb_manufactory.png"); private TileEntityMachineCMBFactory diFurnace; @@ -31,6 +31,7 @@ public class GUIMachineCMBFactory extends GuiFluidContainer { super.drawScreen(mouseX, mouseY, f); diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 69 - 52, 16, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 106 - 88, 16, 88, diFurnace.power, diFurnace.maxPower); } @Override diff --git a/com/hbm/inventory/gui/GUIMachineChemplant.java b/com/hbm/inventory/gui/GUIMachineChemplant.java index bb98ed160..4a77057b1 100644 --- a/com/hbm/inventory/gui/GUIMachineChemplant.java +++ b/com/hbm/inventory/gui/GUIMachineChemplant.java @@ -15,7 +15,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineChemplant extends GuiFluidContainer { +public class GUIMachineChemplant extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_chemplant.png"); private TileEntityMachineChemplant chemplant; @@ -36,6 +36,7 @@ public class GUIMachineChemplant extends GuiFluidContainer { chemplant.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 52 - 34, 16, 34); chemplant.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 52 - 34, 16, 34); chemplant.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 52 - 34, 16, 34); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 44, guiTop + 70 - 52, 16, 52, chemplant.power, chemplant.maxPower); } @Override diff --git a/com/hbm/inventory/gui/GUIMachineCoal.java b/com/hbm/inventory/gui/GUIMachineCoal.java index fe4cbc50f..8a46aecef 100644 --- a/com/hbm/inventory/gui/GUIMachineCoal.java +++ b/com/hbm/inventory/gui/GUIMachineCoal.java @@ -13,7 +13,7 @@ import com.hbm.inventory.container.ContainerMachineCoal; import com.hbm.lib.RefStrings; import com.hbm.tileentity.machine.TileEntityMachineCoal; -public class GUIMachineCoal extends GuiFluidContainer { +public class GUIMachineCoal extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/GUICoal.png"); private TileEntityMachineCoal diFurnace; @@ -31,6 +31,7 @@ public class GUIMachineCoal extends GuiFluidContainer { super.drawScreen(mouseX, mouseY, f); diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 69 - 52, 16, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.maxPower); } @Override diff --git a/com/hbm/inventory/gui/GUIMachineCyclotron.java b/com/hbm/inventory/gui/GUIMachineCyclotron.java index eb5821b34..1d21b22d6 100644 --- a/com/hbm/inventory/gui/GUIMachineCyclotron.java +++ b/com/hbm/inventory/gui/GUIMachineCyclotron.java @@ -12,7 +12,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineCyclotron extends GuiContainer { +public class GUIMachineCyclotron extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_cyclotron.png"); private TileEntityMachineCyclotron diFurnace; @@ -25,6 +25,13 @@ public class GUIMachineCyclotron extends GuiContainer { this.ySize = 222; } + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 106 - 88, 16, 88, diFurnace.power, diFurnace.maxPower); + } + @Override protected void drawGuiContainerForegroundLayer(int i, int j) { String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName()); diff --git a/com/hbm/inventory/gui/GUIMachineDiesel.java b/com/hbm/inventory/gui/GUIMachineDiesel.java index 403e148a2..edf9d969f 100644 --- a/com/hbm/inventory/gui/GUIMachineDiesel.java +++ b/com/hbm/inventory/gui/GUIMachineDiesel.java @@ -13,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineDiesel extends GuiFluidContainer { +public class GUIMachineDiesel extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/GUIDiesel.png"); private TileEntityMachineDiesel diFurnace; @@ -31,6 +31,7 @@ public class GUIMachineDiesel extends GuiFluidContainer { super.drawScreen(mouseX, mouseY, f); diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 69 - 52, 16, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.maxPower); } @Override diff --git a/com/hbm/inventory/gui/GUIMachineElectricFurnace.java b/com/hbm/inventory/gui/GUIMachineElectricFurnace.java index bcd782fe5..c18e4dc47 100644 --- a/com/hbm/inventory/gui/GUIMachineElectricFurnace.java +++ b/com/hbm/inventory/gui/GUIMachineElectricFurnace.java @@ -12,7 +12,7 @@ import com.hbm.inventory.container.ContainerElectricFurnace; import com.hbm.lib.RefStrings; import com.hbm.tileentity.machine.TileEntityMachineElectricFurnace; -public class GUIMachineElectricFurnace extends GuiContainer { +public class GUIMachineElectricFurnace extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/GUIElectricFurnace.png"); private TileEntityMachineElectricFurnace diFurnace; @@ -25,6 +25,13 @@ public class GUIMachineElectricFurnace extends GuiContainer { this.ySize = 166; } + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 20, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.maxPower); + } + @Override protected void drawGuiContainerForegroundLayer(int i, int j) { String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName()); diff --git a/com/hbm/inventory/gui/GUIMachineFluidTank.java b/com/hbm/inventory/gui/GUIMachineFluidTank.java index cf56dcebc..0a6200d30 100644 --- a/com/hbm/inventory/gui/GUIMachineFluidTank.java +++ b/com/hbm/inventory/gui/GUIMachineFluidTank.java @@ -15,7 +15,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineFluidTank extends GuiFluidContainer { +public class GUIMachineFluidTank extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_tank.png"); private TileEntityMachineFluidTank tank; diff --git a/com/hbm/inventory/gui/GUIMachineGasFlare.java b/com/hbm/inventory/gui/GUIMachineGasFlare.java index 160271718..b43d00477 100644 --- a/com/hbm/inventory/gui/GUIMachineGasFlare.java +++ b/com/hbm/inventory/gui/GUIMachineGasFlare.java @@ -13,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineGasFlare extends GuiFluidContainer { +public class GUIMachineGasFlare extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_gasFlare.png"); private TileEntityMachineGasFlare flare; @@ -31,6 +31,7 @@ public class GUIMachineGasFlare extends GuiFluidContainer { super.drawScreen(mouseX, mouseY, f); flare.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 69 - 52, 34, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 69 - 52, 16, 52, flare.power, flare.maxPower); } @Override diff --git a/com/hbm/inventory/gui/GUIMachineGenerator.java b/com/hbm/inventory/gui/GUIMachineGenerator.java index 95bb7c3dc..6903c2747 100644 --- a/com/hbm/inventory/gui/GUIMachineGenerator.java +++ b/com/hbm/inventory/gui/GUIMachineGenerator.java @@ -13,7 +13,7 @@ import com.hbm.inventory.container.ContainerGenerator; import com.hbm.lib.RefStrings; import com.hbm.tileentity.machine.TileEntityMachineGenerator; -public class GUIMachineGenerator extends GuiFluidContainer { +public class GUIMachineGenerator extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_generator.png"); private TileEntityMachineGenerator diFurnace; @@ -32,6 +32,7 @@ public class GUIMachineGenerator extends GuiFluidContainer { diFurnace.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 88 - 52, 16, 52); diFurnace.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 88 - 52, 16, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 88 - 52, 16, 52, diFurnace.power, diFurnace.powerMax); } @Override diff --git a/com/hbm/inventory/gui/GUIMachineInserter.java b/com/hbm/inventory/gui/GUIMachineInserter.java index e2dfe6874..7a3e67913 100644 --- a/com/hbm/inventory/gui/GUIMachineInserter.java +++ b/com/hbm/inventory/gui/GUIMachineInserter.java @@ -14,7 +14,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineInserter extends GuiFluidContainer { +public class GUIMachineInserter extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_inserter.png"); private TileEntityMachineInserter diFurnace; diff --git a/com/hbm/inventory/gui/GUIMachineMiningDrill.java b/com/hbm/inventory/gui/GUIMachineMiningDrill.java index ff0b93257..4f8cdf228 100644 --- a/com/hbm/inventory/gui/GUIMachineMiningDrill.java +++ b/com/hbm/inventory/gui/GUIMachineMiningDrill.java @@ -12,7 +12,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineMiningDrill extends GuiContainer { +public class GUIMachineMiningDrill extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_drill.png"); private TileEntityMachineMiningDrill diFurnace; @@ -25,6 +25,13 @@ public class GUIMachineMiningDrill extends GuiContainer { this.ySize = 166; } + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.maxPower); + } + @Override protected void drawGuiContainerForegroundLayer(int i, int j) { String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName()); diff --git a/com/hbm/inventory/gui/GUIMachineOilWell.java b/com/hbm/inventory/gui/GUIMachineOilWell.java index 7a3838264..ffb1e8ed5 100644 --- a/com/hbm/inventory/gui/GUIMachineOilWell.java +++ b/com/hbm/inventory/gui/GUIMachineOilWell.java @@ -13,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineOilWell extends GuiFluidContainer { +public class GUIMachineOilWell extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_well_large.png"); private TileEntityMachineOilWell derrick; @@ -32,6 +32,7 @@ public class GUIMachineOilWell extends GuiFluidContainer { derrick.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 70 - 52, 34, 52); derrick.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 124 - 52, 34, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 70 - 52, 16, 52, derrick.power, derrick.maxPower); } @Override diff --git a/com/hbm/inventory/gui/GUIMachinePuF6Tank.java b/com/hbm/inventory/gui/GUIMachinePuF6Tank.java index 95ac1cd9d..03fda75b0 100644 --- a/com/hbm/inventory/gui/GUIMachinePuF6Tank.java +++ b/com/hbm/inventory/gui/GUIMachinePuF6Tank.java @@ -13,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachinePuF6Tank extends GuiFluidContainer { +public class GUIMachinePuF6Tank extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/puf6Tank.png"); private TileEntityMachinePuF6Tank tank; diff --git a/com/hbm/inventory/gui/GUIMachinePumpjack.java b/com/hbm/inventory/gui/GUIMachinePumpjack.java index 94b66722a..d1bdf467e 100644 --- a/com/hbm/inventory/gui/GUIMachinePumpjack.java +++ b/com/hbm/inventory/gui/GUIMachinePumpjack.java @@ -15,7 +15,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachinePumpjack extends GuiFluidContainer { +public class GUIMachinePumpjack extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_well_large.png"); private TileEntityMachinePumpjack derrick; @@ -34,6 +34,7 @@ public class GUIMachinePumpjack extends GuiFluidContainer { derrick.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 70 - 52, 34, 52); derrick.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 124 - 52, 34, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 70 - 52, 16, 52, derrick.power, derrick.maxPower); } @Override diff --git a/com/hbm/inventory/gui/GUIMachineRTG.java b/com/hbm/inventory/gui/GUIMachineRTG.java index 24b33d07d..41b074d05 100644 --- a/com/hbm/inventory/gui/GUIMachineRTG.java +++ b/com/hbm/inventory/gui/GUIMachineRTG.java @@ -12,7 +12,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineRTG extends GuiContainer { +public class GUIMachineRTG extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_rtg.png"); private TileEntityMachineRTG rtg; @@ -24,6 +24,13 @@ public class GUIMachineRTG extends GuiContainer { this.xSize = 176; this.ySize = 166; } + + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52, rtg.power, rtg.powerMax); + } @Override protected void drawGuiContainerForegroundLayer( int i, int j) { diff --git a/com/hbm/inventory/gui/GUIMachineRefinery.java b/com/hbm/inventory/gui/GUIMachineRefinery.java index db188a443..aeac6ac85 100644 --- a/com/hbm/inventory/gui/GUIMachineRefinery.java +++ b/com/hbm/inventory/gui/GUIMachineRefinery.java @@ -13,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineRefinery extends GuiFluidContainer { +public class GUIMachineRefinery extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_refinery.png"); private TileEntityMachineRefinery refinery; @@ -35,6 +35,7 @@ public class GUIMachineRefinery extends GuiFluidContainer { refinery.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 98, guiTop + 70 - 52, 16, 52); refinery.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 116, guiTop + 70 - 52, 16, 52); refinery.tanks[4].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 70 - 52, 16, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 70 - 52, 16, 52, refinery.power, refinery.maxPower); } @Override diff --git a/com/hbm/inventory/gui/GUIMachineShredder.java b/com/hbm/inventory/gui/GUIMachineShredder.java index a81426362..11df2e518 100644 --- a/com/hbm/inventory/gui/GUIMachineShredder.java +++ b/com/hbm/inventory/gui/GUIMachineShredder.java @@ -12,7 +12,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineShredder extends GuiContainer { +public class GUIMachineShredder extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_shredder.png"); private TileEntityMachineShredder diFurnace; @@ -25,6 +25,13 @@ public class GUIMachineShredder extends GuiContainer { this.ySize = 222; } + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 106 - 88, 16, 88, diFurnace.power, diFurnace.maxPower); + } + @Override protected void drawGuiContainerForegroundLayer(int i, int j) { String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName()); diff --git a/com/hbm/inventory/gui/GUIMachineTurbofan.java b/com/hbm/inventory/gui/GUIMachineTurbofan.java index c06cc97b7..07837e30b 100644 --- a/com/hbm/inventory/gui/GUIMachineTurbofan.java +++ b/com/hbm/inventory/gui/GUIMachineTurbofan.java @@ -14,7 +14,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineTurbofan extends GuiFluidContainer { +public class GUIMachineTurbofan extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_turbofan.png"); private TileEntityMachineTurbofan diFurnace; diff --git a/com/hbm/inventory/gui/GUIMachineUF6Tank.java b/com/hbm/inventory/gui/GUIMachineUF6Tank.java index 84bc6806d..e9aa8c15e 100644 --- a/com/hbm/inventory/gui/GUIMachineUF6Tank.java +++ b/com/hbm/inventory/gui/GUIMachineUF6Tank.java @@ -12,7 +12,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIMachineUF6Tank extends GuiFluidContainer { +public class GUIMachineUF6Tank extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/uf6Tank.png"); private TileEntityMachineUF6Tank tank; diff --git a/com/hbm/inventory/gui/GUIReactorMultiblock.java b/com/hbm/inventory/gui/GUIReactorMultiblock.java index 049ad49af..9b32ecc41 100644 --- a/com/hbm/inventory/gui/GUIReactorMultiblock.java +++ b/com/hbm/inventory/gui/GUIReactorMultiblock.java @@ -13,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIReactorMultiblock extends GuiFluidContainer { +public class GUIReactorMultiblock extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_reactor_multiblock.png"); private TileEntityReactorMultiblock diFurnace; diff --git a/com/hbm/inventory/gui/GUIWatzCore.java b/com/hbm/inventory/gui/GUIWatzCore.java index 8bc63c394..a3c4f04ca 100644 --- a/com/hbm/inventory/gui/GUIWatzCore.java +++ b/com/hbm/inventory/gui/GUIWatzCore.java @@ -13,7 +13,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -public class GUIWatzCore extends GuiFluidContainer { +public class GUIWatzCore extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_watz_multiblock.png"); private TileEntityWatzCore diFurnace; diff --git a/com/hbm/inventory/gui/GuiFluidContainer.java b/com/hbm/inventory/gui/GuiFluidContainer.java deleted file mode 100644 index b888506ed..000000000 --- a/com/hbm/inventory/gui/GuiFluidContainer.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.hbm.inventory.gui; - -import java.util.Arrays; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; - -public abstract class GuiFluidContainer extends GuiContainer { - - public GuiFluidContainer(Container p_i1072_1_) { - super(p_i1072_1_); - } - - public void drawFluidInfo(String[] text, int x, int y) { - this.func_146283_a(Arrays.asList(text), x, y); - } - -} diff --git a/com/hbm/inventory/gui/GuiInfoContainer.java b/com/hbm/inventory/gui/GuiInfoContainer.java new file mode 100644 index 000000000..fe784566c --- /dev/null +++ b/com/hbm/inventory/gui/GuiInfoContainer.java @@ -0,0 +1,24 @@ +package com.hbm.inventory.gui; + +import java.util.Arrays; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.inventory.Container; + +public abstract class GuiInfoContainer extends GuiContainer { + + public GuiInfoContainer(Container p_i1072_1_) { + super(p_i1072_1_); + } + + public void drawFluidInfo(String[] text, int x, int y) { + this.func_146283_a(Arrays.asList(text), x, y); + } + + public void drawElectricityInfo(GuiInfoContainer gui, int mouseX, int mouseY, int x, int y, int width, int height, long power, long maxPower) { + if(x <= mouseX && x + width > mouseX && y < mouseY && y + height >= mouseY) + gui.drawFluidInfo(new String[] { power + "/" + maxPower + "HE" }, mouseX, mouseY); + } + +} diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 153527cd8..3caef05b3 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -2768,8 +2768,8 @@ public class ModItems { GameRegistry.registerItem(gun_spark, gun_spark.getUnlocalizedName()); GameRegistry.registerItem(gun_hp, gun_hp.getUnlocalizedName()); GameRegistry.registerItem(gun_euthanasia, gun_euthanasia.getUnlocalizedName()); - GameRegistry.registerItem(gun_dash, gun_dash.getUnlocalizedName()); - GameRegistry.registerItem(gun_twigun, gun_twigun.getUnlocalizedName()); + //GameRegistry.registerItem(gun_dash, gun_dash.getUnlocalizedName()); + //GameRegistry.registerItem(gun_twigun, gun_twigun.getUnlocalizedName()); GameRegistry.registerItem(gun_defabricator, gun_defabricator.getUnlocalizedName()); GameRegistry.registerItem(gun_super_shotgun, gun_super_shotgun.getUnlocalizedName()); GameRegistry.registerItem(gun_moist_nugget, gun_moist_nugget.getUnlocalizedName()); @@ -3086,7 +3086,7 @@ public class ModItems { //GameRegistry.registerItem(remote, remote.getUnlocalizedName()); GameRegistry.registerItem(euphemium_stopper, euphemium_stopper.getUnlocalizedName()); GameRegistry.registerItem(polaroid, polaroid.getUnlocalizedName()); - GameRegistry.registerItem(glitch, glitch.getUnlocalizedName()); + //GameRegistry.registerItem(glitch, glitch.getUnlocalizedName()); GameRegistry.registerItem(book_secret, book_secret.getUnlocalizedName()); GameRegistry.registerItem(burnt_bark, burnt_bark.getUnlocalizedName()); diff --git a/com/hbm/items/weapon/GunSuicide.java b/com/hbm/items/weapon/GunSuicide.java index aa4ce465e..6c72cba74 100644 --- a/com/hbm/items/weapon/GunSuicide.java +++ b/com/hbm/items/weapon/GunSuicide.java @@ -119,7 +119,7 @@ public class GunSuicide extends Item { if (!p_77615_2_.isRemote) { - p_77615_3_.attackEntityFrom(ModDamageSource.suicide, Float.POSITIVE_INFINITY); + p_77615_3_.attackEntityFrom(ModDamageSource.suicide, 100000); } } } diff --git a/com/hbm/lib/Library.java b/com/hbm/lib/Library.java index 25eea6fce..a8a381b90 100644 --- a/com/hbm/lib/Library.java +++ b/com/hbm/lib/Library.java @@ -320,7 +320,8 @@ public class Library { world.getBlock(x, y, z) == ModBlocks.dummy_port_turbofan || world.getBlock(x, y, z) == ModBlocks.reactor_hatch || world.getBlock(x, y, z) == ModBlocks.fusion_hatch || - world.getBlock(x, y, z) == ModBlocks.watz_hatch) + world.getBlock(x, y, z) == ModBlocks.watz_hatch || + world.getBlock(x, y, z) == ModBlocks.fwatz_hatch) { return true; } @@ -1017,6 +1018,23 @@ public class Library { { tileentity = worldObj.getTileEntity(x - 8, y, z); } + //FWatz Reactor + if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x, y + 11, z + 9) == ModBlocks.fwatz_core) + { + tileentity = worldObj.getTileEntity(x, y + 11, z + 9); + } + if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x, y + 11, z - 9) == ModBlocks.fwatz_core) + { + tileentity = worldObj.getTileEntity(x, y + 11, z - 9); + } + if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x + 9, y + 11, z) == ModBlocks.fwatz_core) + { + tileentity = worldObj.getTileEntity(x + 9, y + 11, z); + } + if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x - 9, y + 11, z) == ModBlocks.fwatz_core) + { + tileentity = worldObj.getTileEntity(x - 9, y + 11, z); + } if(tileentity == that) tileentity = null; diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 63810d6fb..4f91976a9 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -56,6 +56,7 @@ public class CraftingManager { //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.drill_titanium, 1), new Object[] { " B ", "IBI", "PPP", 'B', ModItems.bolt_dura_steel, 'I', ModItems.ingot_dura_steel, 'P', "plateTitanium" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.bolt_tungsten, 4), new Object[] { "D", "D", 'D', "ingotTungsten" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.bolt_compound, 1), new Object[] { "PDP", "PTP", "PDP", 'D', ModItems.bolt_dura_steel, 'T', ModItems.bolt_tungsten, 'P', "plateTitanium" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.pellet_coal, 1), new Object[] { "PFP", "FOF", "PFP", 'P', "dustCoal", 'F', Items.flint, 'O', ModBlocks.gravel_obsidian })); //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.magnet_dee, 1), new Object[] { "SMM", "M M", "MMT", 'S', "ingotSteel", 'M', ModBlocks.fusion_conductor, 'T', ModItems.coil_advanced_torus })); //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.magnet_circular, 2), new Object[] { "PSP", "MMM", "PSP", 'S', "ingotSteel", 'M', ModBlocks.fusion_conductor, 'P', "plateAdvanced" })); @@ -595,8 +596,8 @@ public class CraftingManager { //GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.watz_core), 1), new Object[] { "CWC", "CRC", "CWC", 'C', ModItems.circuit_schrabidium, 'W', Item.getItemFromBlock(ModBlocks.watz_conductor), 'R', Item.getItemFromBlock(ModBlocks.block_meteor) }); //GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fwatz_conductor), 1), new Object[] { "SSS", "CCC", "SSS", 'S', ModItems.plate_combine_steel, 'C', ModItems.coil_magnetized_tungsten }); - //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fwatz_cooler), 1), new Object[] { "IPI", "IPI", "IPI", 'I', "ingotTitanium", 'P', "plateTitanium" })); - //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fwatz_tank), 1), new Object[] { "CGC", "GGG", "CGC", 'C', ModItems.plate_combine_steel, 'G', "paneGlass" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fwatz_cooler), 1), new Object[] { "IPI", "IPI", "IPI", 'I', "ingotTitanium", 'P', "plateTitanium" })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fwatz_tank), 1), new Object[] { "CGC", "GGG", "CGC", 'C', ModItems.plate_combine_steel, 'G', "paneGlass" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fwatz_scaffold), 1), new Object[] { "IPI", "P P", "IPI", 'I', "ingotTungsten", 'P', "plateDenseLead" })); //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fwatz_hatch), 1), new Object[] { "SSS", "SFS", "SSS", 'S', ModBlocks.fwatz_scaffold, 'F', Blocks.furnace })); //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fwatz_computer), 1), new Object[] { "DTD", "TMT", "DTD", 'D', "dustDiamond", 'T', "dustMagnetizedTungsten", 'M', ModBlocks.block_meteor })); @@ -967,7 +968,6 @@ public class CraftingManager { GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_stopper, 1), new Object[] { "I", "S", "S", 'I', new ItemStack(ModItems.ingot_euphemium, 1, 34), 'S', Items.stick }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.matchstick, 16), new Object[] { "I", "S", 'I', "sulfur", 'S', Items.stick })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.matchstick, 16), new Object[] { "I", "S", 'I', "dustSulfur", 'S', Items.stick })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.remote, 1), new Object[] { "I", "S", 'I', "dustRedstone", 'S', "plateIron" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.crowbar, 1), new Object[] { "II", " I", " I", 'I', "ingotSteel" })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_power, 5), new Object[] { "dustRedstone", "dustGlowstone", "dustDiamond", "dustNeptunium", "dustMagnetizedTungsten" })); diff --git a/com/hbm/packet/AuxElectricityPacket.java b/com/hbm/packet/AuxElectricityPacket.java new file mode 100644 index 000000000..f30241460 --- /dev/null +++ b/com/hbm/packet/AuxElectricityPacket.java @@ -0,0 +1,75 @@ +package com.hbm.packet; + +import com.hbm.interfaces.IConsumer; +import com.hbm.interfaces.ISource; +import com.hbm.tileentity.machine.TileEntityMachinePress; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +public class AuxElectricityPacket implements IMessage { + + int x; + int y; + int z; + int charge; + + public AuxElectricityPacket() + { + + } + + public AuxElectricityPacket(int x, int y, int z, int charge) + { + this.x = x; + this.y = y; + this.z = z; + this.charge = charge; + } + + @Override + public void fromBytes(ByteBuf buf) { + x = buf.readInt(); + y = buf.readInt(); + z = buf.readInt(); + charge = buf.readInt(); + } + + @Override + public void toBytes(ByteBuf buf) { + buf.writeInt(x); + buf.writeInt(y); + buf.writeInt(z); + buf.writeInt(charge); + } + + public static class Handler implements IMessageHandler { + + @Override + @SideOnly(Side.CLIENT) + public IMessage onMessage(AuxElectricityPacket m, MessageContext ctx) { + try { + TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z); + + if (te != null && te instanceof IConsumer) { + + IConsumer gen = (IConsumer) te; + gen.setPower(m.charge); + } else if (te != null && te instanceof ISource) { + + ISource gen = (ISource) te; + gen.setSPower(m.charge); + } + } catch (Exception x) { } + return null; + } + } +} diff --git a/com/hbm/packet/PacketDispatcher.java b/com/hbm/packet/PacketDispatcher.java index 898e6bb88..b09c050e3 100644 --- a/com/hbm/packet/PacketDispatcher.java +++ b/com/hbm/packet/PacketDispatcher.java @@ -49,6 +49,8 @@ public class PacketDispatcher { wrapper.registerMessage(TETurbofanPacket.Handler.class, TETurbofanPacket.class, i++, Side.CLIENT); //Press item for rendering wrapper.registerMessage(TEPressPacket.Handler.class, TEPressPacket.class, i++, Side.CLIENT); + //Electricity gauge for GUI rendering + wrapper.registerMessage(AuxElectricityPacket.Handler.class, AuxElectricityPacket.class, i++, Side.CLIENT); } } diff --git a/com/hbm/tileentity/bomb/TileEntityLaunchPad.java b/com/hbm/tileentity/bomb/TileEntityLaunchPad.java index e07e42953..b9ed56736 100644 --- a/com/hbm/tileentity/bomb/TileEntityLaunchPad.java +++ b/com/hbm/tileentity/bomb/TileEntityLaunchPad.java @@ -3,6 +3,7 @@ package com.hbm.tileentity.bomb; import com.hbm.interfaces.IConsumer; import com.hbm.items.ModItems; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.TEMissilePacket; @@ -191,8 +192,10 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory, power = Library.chargeTEFromItems(slots, 2, power, maxPower); - if(!worldObj.isRemote) + if(!worldObj.isRemote) { PacketDispatcher.wrapper.sendToAll(new TEMissilePacket(xCoord, yCoord, zCoord, slots[0])); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); + } } @Override diff --git a/com/hbm/tileentity/machine/TileEntityFWatzCore.java b/com/hbm/tileentity/machine/TileEntityFWatzCore.java index e66ed8d7d..190caff87 100644 --- a/com/hbm/tileentity/machine/TileEntityFWatzCore.java +++ b/com/hbm/tileentity/machine/TileEntityFWatzCore.java @@ -4,11 +4,17 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.interfaces.IConsumer; +import com.hbm.interfaces.IFluidAcceptor; +import com.hbm.interfaces.IFluidContainer; import com.hbm.interfaces.IReactor; import com.hbm.interfaces.ISource; +import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import com.hbm.world.FWatz; import net.minecraft.entity.player.EntityPlayer; @@ -20,17 +26,13 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, IReactor, ISource { +public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, IReactor, ISource, IFluidContainer, IFluidAcceptor { - public int cool; - public final static int maxCool = 100000000; public int power; public final static int maxPower = 100000000; - public int amat; - public final static int maxAmat = 100000000; - public int aSchrab; - public final static int maxASchrab = 100000000; public boolean cooldown = false; + + public FluidTank tanks[]; Random rand = new Random(); @@ -41,7 +43,11 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, private String customName; public TileEntityFWatzCore() { - slots = new ItemStack[5]; + slots = new ItemStack[7]; + tanks = new FluidTank[3]; + tanks[0] = new FluidTank(FluidType.COOLANT, 128000, 0); + tanks[1] = new FluidTank(FluidType.AMAT, 64000, 1); + tanks[2] = new FluidTank(FluidType.ASCHRAB, 64000, 2); } @Override public int getSizeInventory() { @@ -156,10 +162,10 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, super.readFromNBT(nbt); NBTTagList list = nbt.getTagList("items", 10); - cool = nbt.getInteger("cool"); power = nbt.getInteger("power"); - amat = nbt.getInteger("amat"); - aSchrab = nbt.getInteger("aSchrab"); + tanks[0].readFromNBT(nbt, "cool"); + tanks[1].readFromNBT(nbt, "amat"); + tanks[2].readFromNBT(nbt, "aschrab"); slots = new ItemStack[getSizeInventory()]; @@ -177,10 +183,12 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); - nbt.setInteger("cool", cool); + nbt.setInteger("power", power); - nbt.setInteger("amat", amat); - nbt.setInteger("aSchrab", aSchrab); + tanks[0].writeToNBT(nbt, "cool"); + tanks[1].writeToNBT(nbt, "amat"); + tanks[2].writeToNBT(nbt, "aschrab"); + NBTTagList list = new NBTTagList(); for(int i = 0; i < slots.length; i++) @@ -215,7 +223,7 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, @Override public int getCoolantScaled(int i) { - return (cool/100 * i) / (maxCool/100); + return 0; } @Override @@ -225,12 +233,12 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, @Override public int getWaterScaled(int i) { - return (amat/100 * i) / (maxAmat/100); + return 0; } @Override public int getHeatScaled(int i) { - return (aSchrab/100 * i) / (maxASchrab/100); + return 0; } public int getSingularityType() { @@ -255,7 +263,7 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, @Override public void updateEntity() { - if (this.isStructureValid(this.worldObj)) { + if (this.isStructureValid(this.worldObj) && !worldObj.isRemote) { age++; if (age >= 20) { @@ -265,25 +273,25 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, if (age == 9 || age == 19) ffgeuaInit(); - if (hasFuse() && getSingularityType() > 0 && isStructureValid(worldObj)) { + if (hasFuse() && getSingularityType() > 0) { if(cooldown) { int i = getSingularityType(); if(i == 1) - cool += 1500; + tanks[0].setFill(tanks[0].getFill() + 1500); if(i == 2) - cool += 3000; + tanks[0].setFill(tanks[0].getFill() + 3000); if(i == 3) - cool += 750; + tanks[0].setFill(tanks[0].getFill() + 750); if(i == 4) - cool += 7500; + tanks[0].setFill(tanks[0].getFill() + 7500); if(i == 5) - cool += 150000; + tanks[0].setFill(tanks[0].getFill() + 15000); - if(cool >= maxCool) { + if(tanks[0].getFill() >= tanks[0].getMaxFill()) { cooldown = false; - cool = maxCool; + tanks[0].setFill(tanks[0].getMaxFill()); } } else { @@ -291,38 +299,38 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, boolean isWorking = false; - if(i == 1 && amat - 750 >= 0 && aSchrab - 750 >= 0) { - cool -= 150; - amat -= 750; - aSchrab -= 750; + if(i == 1 && tanks[1].getFill() - 750 >= 0 && tanks[2].getFill() - 750 >= 0) { + tanks[0].setFill(tanks[0].getFill() - 150); + tanks[1].setFill(tanks[1].getFill() - 750); + tanks[2].setFill(tanks[2].getFill() - 750); power += 500000; isWorking = true; } - if(i == 2 && amat - 750 >= 0 && aSchrab - 350 >= 0) { - cool -= 75; - amat -= 350; - aSchrab -= 300; + if(i == 2 && tanks[1].getFill() - 750 >= 0 && tanks[2].getFill() - 350 >= 0) { + tanks[0].setFill(tanks[0].getFill() - 75); + tanks[1].setFill(tanks[1].getFill() - 350); + tanks[2].setFill(tanks[2].getFill() - 300); power += 250000; isWorking = true; } - if(i == 3 && amat - 750 >= 0 && aSchrab - 1400 >= 0) { - cool -= 300; - amat -= 750; - aSchrab -= 1400; + if(i == 3 && tanks[1].getFill() - 750 >= 0 && tanks[2].getFill() - 1400 >= 0) { + tanks[0].setFill(tanks[0].getFill() - 300); + tanks[1].setFill(tanks[1].getFill() - 750); + tanks[2].setFill(tanks[2].getFill() - 1400); power += 1000000; isWorking = true; } - if(i == 4 && amat - 1000 >= 0 && aSchrab - 1000 >= 0) { - cool -= 100; - amat -= 1000; - aSchrab -= 1000; + if(i == 4 && tanks[1].getFill() - 1000 >= 0 && tanks[2].getFill() - 1000 >= 0) { + tanks[0].setFill(tanks[0].getFill() - 100); + tanks[1].setFill(tanks[1].getFill() - 1000); + tanks[2].setFill(tanks[2].getFill() - 1000); power += 1000000; isWorking = true; } - if(i == 5 && amat - 150 >= 0 && aSchrab - 150 >= 0) { - cool -= 150; - amat -= 150; - aSchrab -= 150; + if(i == 5 && tanks[1].getFill() - 150 >= 0 && tanks[2].getFill() - 150 >= 0) { + tanks[0].setFill(tanks[0].getFill() - 150); + tanks[1].setFill(tanks[1].getFill() - 150); + tanks[2].setFill(tanks[2].getFill() - 150); power += 10000000; isWorking = true; } @@ -330,9 +338,9 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, if(power > maxPower) power = maxPower; - if(cool <= 0) { + if(tanks[0].getFill() <= 0) { cooldown = true; - cool = 0; + tanks[0].setFill(0); } } } @@ -342,41 +350,20 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, power = Library.chargeItemsFromTE(slots, 0, power, maxPower); + tanks[1].loadTank(3, 5, slots); + tanks[2].loadTank(4, 6, slots); - if(amat + 1000000 <= maxAmat && slots[3] != null && slots[3].getItem() == ModItems.cell_antimatter) - { - this.slots[3].stackSize--; - this.amat += 1000000; - if(this.slots[3].stackSize == 0) - { - this.slots[3] = null; - } - } - if(aSchrab + 1000000 <= maxASchrab && slots[4] != null && slots[4].getItem() == ModItems.cell_anti_schrabidium) - { - this.slots[4].stackSize--; - this.aSchrab += 1000000; - if(this.slots[4].stackSize == 0) - { - this.slots[4] = null; - } - } - - if(slots[3] != null && slots[3].getItem() == ModItems.inf_antimatter) - { - this.amat = maxAmat; - } - if(slots[4] != null && slots[4].getItem() == ModItems.inf_antischrabidium) - { - this.aSchrab = maxASchrab; - } + for(int i = 0; i < 3; i++) + tanks[i].updateTank(xCoord, yCoord, zCoord); } - if(this.isRunning() && (amat <= 0 || aSchrab <= 0 || !hasFuse() || getSingularityType() == 0) || cooldown || !this.isStructureValid(worldObj)) + if(this.isRunning() && (tanks[1].getFill() <= 0 || tanks[2].getFill() <= 0 || !hasFuse() || getSingularityType() == 0) || cooldown || !this.isStructureValid(worldObj)) this.emptyPlasma(); - if(!this.isRunning() && amat >= 1000 && aSchrab >= 1000 && hasFuse() && getSingularityType() > 0 && !cooldown && this.isStructureValid(worldObj)) + if(!this.isRunning() && tanks[1].getFill() >= 1000 && tanks[2].getFill() >= 1000 && hasFuse() && getSingularityType() > 0 && !cooldown && this.isStructureValid(worldObj)) this.fillPlasma(); + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } public void fillPlasma() { @@ -436,4 +423,44 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, public void clearList() { this.list.clear(); } + + @Override + public void setFillstate(int fill, int index) { + if(index < 3 && tanks[index] != null) + tanks[index].setFill(fill); + } + + @Override + public void setType(FluidType type, int index) { + if(index < 3 && tanks[index] != null) + tanks[index].setTankType(type); + } + + @Override + public void setAFluidFill(int i, FluidType type) { + if(type.name().equals(tanks[1].getTankType().name())) + tanks[1].setFill(i); + else if(type.name().equals(tanks[2].getTankType().name())) + tanks[2].setFill(i); + } + + @Override + public int getAFluidFill(FluidType type) { + if(type.name().equals(tanks[1].getTankType().name())) + return tanks[1].getFill(); + else if(type.name().equals(tanks[2].getTankType().name())) + return tanks[2].getFill(); + else + return 0; + } + + @Override + public int getMaxAFluidFill(FluidType type) { + if(type.name().equals(tanks[1].getTankType().name())) + return tanks[1].getMaxFill(); + else if(type.name().equals(tanks[2].getTankType().name())) + return tanks[2].getMaxFill(); + else + return 0; + } } diff --git a/com/hbm/tileentity/machine/TileEntityFusionMultiblock.java b/com/hbm/tileentity/machine/TileEntityFusionMultiblock.java index c2e97f397..0445d9f88 100644 --- a/com/hbm/tileentity/machine/TileEntityFusionMultiblock.java +++ b/com/hbm/tileentity/machine/TileEntityFusionMultiblock.java @@ -13,6 +13,8 @@ import com.hbm.interfaces.ISource; import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -1078,6 +1080,8 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve } power = Library.chargeItemsFromTE(slots, 1, power, maxPower); + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineAssembler.java b/com/hbm/tileentity/machine/TileEntityMachineAssembler.java index 805354c55..07409df56 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineAssembler.java +++ b/com/hbm/tileentity/machine/TileEntityMachineAssembler.java @@ -9,6 +9,7 @@ import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.items.tool.ItemAssemblyTemplate; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.LoopedSoundPacket; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.TEAssemblerPacket; @@ -375,6 +376,7 @@ public class TileEntityMachineAssembler extends TileEntity implements ISidedInve PacketDispatcher.wrapper.sendToAll(new TEAssemblerPacket(xCoord, yCoord, zCoord, rotation, isProgressing)); PacketDispatcher.wrapper.sendToAll(new LoopedSoundPacket(xCoord, yCoord, zCoord)); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineBattery.java b/com/hbm/tileentity/machine/TileEntityMachineBattery.java index 771a133be..801233f3f 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineBattery.java +++ b/com/hbm/tileentity/machine/TileEntityMachineBattery.java @@ -7,6 +7,8 @@ import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.ISource; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -224,44 +226,12 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent ffgeuaInit(); } - power = Library.chargeTEFromItems(slots, 0, power, maxPower); + if(!worldObj.isRemote) { + power = Library.chargeTEFromItems(slots, 0, power, maxPower); + power = Library.chargeItemsFromTE(slots, 1, power, maxPower); - power = Library.chargeItemsFromTE(slots, 1, power, maxPower); - - /*if(slots[0] != null && slots[0].getItem() == ModItems.battery_creative) - { - power = maxPower; + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } - - if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.battery_generic && slots[0].getItemDamage() < 50) - { - power += 100; - slots[0].setItemDamage(slots[0].getItemDamage() + 1); - } - - if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.battery_advanced && slots[0].getItemDamage() < 200) - { - power += 100; - slots[0].setItemDamage(slots[0].getItemDamage() + 1); - } - - if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.battery_schrabidium && slots[0].getItemDamage() < 10000) - { - power += 100; - slots[0].setItemDamage(slots[0].getItemDamage() + 1); - } - - if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.fusion_core && slots[0].getItemDamage() < 5000) - { - power += 100; - slots[0].setItemDamage(slots[0].getItemDamage() + 1); - } - - if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.energy_core && slots[0].getItemDamage() < 5000) - { - power += 100; - slots[0].setItemDamage(slots[0].getItemDamage() + 1); - }*/ } @Override diff --git a/com/hbm/tileentity/machine/TileEntityMachineCMBFactory.java b/com/hbm/tileentity/machine/TileEntityMachineCMBFactory.java index 471a48871..f561d804e 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineCMBFactory.java +++ b/com/hbm/tileentity/machine/TileEntityMachineCMBFactory.java @@ -8,6 +8,8 @@ import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; @@ -296,6 +298,8 @@ public class TileEntityMachineCMBFactory extends TileEntity implements ISidedInv } else { process = 0; } + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineChemplant.java b/com/hbm/tileentity/machine/TileEntityMachineChemplant.java index 27dc9e645..9f885d872 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineChemplant.java +++ b/com/hbm/tileentity/machine/TileEntityMachineChemplant.java @@ -17,6 +17,7 @@ import com.hbm.items.special.ItemBattery; import com.hbm.items.tool.ItemAssemblyTemplate; import com.hbm.items.tool.ItemChemistryTemplate; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.LoopedSoundPacket; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.TEAssemblerPacket; @@ -434,6 +435,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve PacketDispatcher.wrapper.sendToAll(new TEChemplantPacket(xCoord, yCoord, zCoord, rotation, isProgressing)); PacketDispatcher.wrapper.sendToAll(new LoopedSoundPacket(xCoord, yCoord, zCoord)); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineCoal.java b/com/hbm/tileentity/machine/TileEntityMachineCoal.java index b0422a125..5d9f76e16 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineCoal.java +++ b/com/hbm/tileentity/machine/TileEntityMachineCoal.java @@ -23,6 +23,8 @@ import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; public class TileEntityMachineCoal extends TileEntity implements ISidedInventory, ISource, IFluidContainer, IFluidAcceptor { @@ -253,6 +255,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory flag1 = true; MachineCoal.updateBlockState(this.burnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); } + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } generate(); diff --git a/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java b/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java index 28f1698d8..bf61f8115 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java +++ b/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java @@ -17,6 +17,8 @@ import com.hbm.inventory.MachineRecipes; import com.hbm.items.ModItems; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -318,6 +320,7 @@ public class TileEntityMachineCyclotron extends TileEntity implements ISidedInve } power = Library.chargeItemsFromTE(slots, 9, power, maxPower); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineDiesel.java b/com/hbm/tileentity/machine/TileEntityMachineDiesel.java index bd6e48d87..9f444a327 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineDiesel.java +++ b/com/hbm/tileentity/machine/TileEntityMachineDiesel.java @@ -13,6 +13,8 @@ import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -228,6 +230,8 @@ public class TileEntityMachineDiesel extends TileEntity implements ISidedInvento power = Library.chargeItemsFromTE(slots, 2, power, maxPower); generate(); + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineElectricFurnace.java b/com/hbm/tileentity/machine/TileEntityMachineElectricFurnace.java index a2e72aaac..8b1f6a98f 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineElectricFurnace.java +++ b/com/hbm/tileentity/machine/TileEntityMachineElectricFurnace.java @@ -4,6 +4,8 @@ import com.hbm.blocks.machine.MachineElectricFurnace; import com.hbm.interfaces.IConsumer; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -301,9 +303,12 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid flag1 = true; MachineElectricFurnace.updateBlockState(this.dualCookTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); } + + power = Library.chargeTEFromItems(slots, 0, power, maxPower); + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } - power = Library.chargeTEFromItems(slots, 0, power, maxPower); if(flag1) { diff --git a/com/hbm/tileentity/machine/TileEntityMachineGasFlare.java b/com/hbm/tileentity/machine/TileEntityMachineGasFlare.java index fefde9a3d..33b4da062 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineGasFlare.java +++ b/com/hbm/tileentity/machine/TileEntityMachineGasFlare.java @@ -16,6 +16,8 @@ import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -239,6 +241,8 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven } power = Library.chargeItemsFromTE(slots, 0, power, maxPower); + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineGenerator.java b/com/hbm/tileentity/machine/TileEntityMachineGenerator.java index 159bb6cc6..c158a4258 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineGenerator.java +++ b/com/hbm/tileentity/machine/TileEntityMachineGenerator.java @@ -16,6 +16,8 @@ import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.items.special.ItemFuelRod; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -486,6 +488,8 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve if(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord) instanceof MachineGenerator) this.isLoaded = true; } + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java b/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java index 1ae2336fe..b9a506b8d 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java +++ b/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java @@ -8,6 +8,7 @@ import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.ISource; import com.hbm.items.ModItems; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.LoopedSoundPacket; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.TEIGeneratorPacket; @@ -304,6 +305,7 @@ public class TileEntityMachineIGenerator extends TileEntity implements ISidedInv if(!worldObj.isRemote) { PacketDispatcher.wrapper.sendToAll(new TEIGeneratorPacket(xCoord, yCoord, zCoord, rotation, torque)); PacketDispatcher.wrapper.sendToAll(new LoopedSoundPacket(xCoord, yCoord, zCoord)); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineMiningDrill.java b/com/hbm/tileentity/machine/TileEntityMachineMiningDrill.java index a105dd143..f38906027 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineMiningDrill.java +++ b/com/hbm/tileentity/machine/TileEntityMachineMiningDrill.java @@ -7,6 +7,7 @@ import com.hbm.interfaces.IConsumer; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.LoopedSoundPacket; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.TEDrillPacket; @@ -430,6 +431,22 @@ public class TileEntityMachineMiningDrill extends TileEntity implements ISidedIn break; } + if(te != null && te instanceof TileEntityCrateIron) { + TileEntityCrateIron hopper = (TileEntityCrateIron)te; + + for(int i = 1; i < 10; i++) + if(tryFillContainer(hopper, i)) + break; + } + + if(te != null && te instanceof TileEntityCrateSteel) { + TileEntityCrateSteel hopper = (TileEntityCrateSteel)te; + + for(int i = 1; i < 10; i++) + if(tryFillContainer(hopper, i)) + break; + } + if(warning == 0) { torque += 0.1; if(torque > (100/timer)) @@ -448,8 +465,8 @@ public class TileEntityMachineMiningDrill extends TileEntity implements ISidedIn rotation -= 360; PacketDispatcher.wrapper.sendToAll(new TEDrillPacket(xCoord, yCoord, zCoord, rotation)); - PacketDispatcher.wrapper.sendToAll(new TEDrillSoundPacket(xCoord, yCoord, zCoord, torque)); PacketDispatcher.wrapper.sendToAll(new LoopedSoundPacket(xCoord, yCoord, zCoord)); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineOilWell.java b/com/hbm/tileentity/machine/TileEntityMachineOilWell.java index 8093d1120..05db412b4 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineOilWell.java +++ b/com/hbm/tileentity/machine/TileEntityMachineOilWell.java @@ -20,6 +20,8 @@ import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -340,6 +342,8 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent warning2 = 1; } } + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachinePumpjack.java b/com/hbm/tileentity/machine/TileEntityMachinePumpjack.java index 79863ab68..e96cae667 100644 --- a/com/hbm/tileentity/machine/TileEntityMachinePumpjack.java +++ b/com/hbm/tileentity/machine/TileEntityMachinePumpjack.java @@ -16,6 +16,7 @@ import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.TEAssemblerPacket; import com.hbm.packet.TEPumpjackPacket; @@ -345,6 +346,7 @@ public class TileEntityMachinePumpjack extends TileEntity implements ISidedInven rotation = rotation % 360; PacketDispatcher.wrapper.sendToAll(new TEPumpjackPacket(xCoord, yCoord, zCoord, rotation, isProgressing)); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineRTG.java b/com/hbm/tileentity/machine/TileEntityMachineRTG.java index 09c3c646c..235edf929 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineRTG.java +++ b/com/hbm/tileentity/machine/TileEntityMachineRTG.java @@ -6,6 +6,8 @@ import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.ISource; import com.hbm.items.ModItems; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -231,6 +233,8 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory, power += heat; if(power > powerMax) power = powerMax; + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineRefinery.java b/com/hbm/tileentity/machine/TileEntityMachineRefinery.java index b59c6debd..907815b13 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineRefinery.java +++ b/com/hbm/tileentity/machine/TileEntityMachineRefinery.java @@ -13,6 +13,8 @@ import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -305,6 +307,7 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven sulfur -= maxSulfur; } } + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineSchrabidiumTransmutator.java b/com/hbm/tileentity/machine/TileEntityMachineSchrabidiumTransmutator.java index be3213bd4..2ad016dfa 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineSchrabidiumTransmutator.java +++ b/com/hbm/tileentity/machine/TileEntityMachineSchrabidiumTransmutator.java @@ -6,6 +6,8 @@ import com.hbm.interfaces.IConsumer; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -277,6 +279,8 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme } else { process = 0; } + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineShredder.java b/com/hbm/tileentity/machine/TileEntityMachineShredder.java index 21685900e..4bb783c0e 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineShredder.java +++ b/com/hbm/tileentity/machine/TileEntityMachineShredder.java @@ -5,6 +5,8 @@ import com.hbm.inventory.MachineRecipes; import com.hbm.items.special.ItemBattery; import com.hbm.items.special.ItemBlades; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -251,6 +253,8 @@ public class TileEntityMachineShredder extends TileEntity implements ISidedInven power = Library.chargeTEFromItems(slots, 29, power, maxPower); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); + if(flag1) { this.markDirty(); diff --git a/com/hbm/tileentity/machine/TileEntityMachineTurbofan.java b/com/hbm/tileentity/machine/TileEntityMachineTurbofan.java index da4adab98..9f8c9881d 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineTurbofan.java +++ b/com/hbm/tileentity/machine/TileEntityMachineTurbofan.java @@ -18,6 +18,7 @@ import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; +import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.LoopedSoundPacket; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.TEIGeneratorPacket; @@ -482,6 +483,7 @@ public class TileEntityMachineTurbofan extends TileEntity implements ISidedInven if(!worldObj.isRemote) { PacketDispatcher.wrapper.sendToAll(new TETurbofanPacket(xCoord, yCoord, zCoord, spin, isRunning)); PacketDispatcher.wrapper.sendToAll(new LoopedSoundPacket(xCoord, yCoord, zCoord)); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityReactorMultiblock.java b/com/hbm/tileentity/machine/TileEntityReactorMultiblock.java index 8c044db62..512429668 100644 --- a/com/hbm/tileentity/machine/TileEntityReactorMultiblock.java +++ b/com/hbm/tileentity/machine/TileEntityReactorMultiblock.java @@ -20,6 +20,8 @@ import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; import com.hbm.items.special.ItemFuelRod; import com.hbm.lib.Library; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -516,8 +518,9 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv } //Batteries - power = Library.chargeItemsFromTE(slots, 34, power, maxPower); + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } } diff --git a/com/hbm/tileentity/machine/TileEntityWatzCore.java b/com/hbm/tileentity/machine/TileEntityWatzCore.java index 76655539c..678c7acee 100644 --- a/com/hbm/tileentity/machine/TileEntityWatzCore.java +++ b/com/hbm/tileentity/machine/TileEntityWatzCore.java @@ -18,6 +18,8 @@ import com.hbm.items.ModItems; import com.hbm.items.special.WatzFuel; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -514,7 +516,7 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I @Override public void updateEntity() { - if (this.isStructureValid(this.worldObj)) { + if (this.isStructureValid(this.worldObj) && !worldObj.isRemote) { age++; if (age >= 20) { @@ -590,6 +592,8 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I } } } + + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); } }