From b8171f20b8878b140fab1e4831cd727229471888 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 2 Jul 2015 00:35:38 +0200 Subject: [PATCH] -Fixed a potential Bug with full machines not showing they're full --- .../inventory/ContainerCanolaPress.java | 7 +++---- .../inventory/ContainerCoalGenerator.java | 7 +++---- .../inventory/ContainerEnergizer.java | 7 +++---- .../inventory/ContainerEnervator.java | 7 +++---- .../inventory/ContainerGrinder.java | 15 +++++++-------- .../inventory/ContainerOilGenerator.java | 7 +++---- .../inventory/ContainerRepairer.java | 7 +++---- .../inventory/gui/GuiCanolaPress.java | 2 +- .../inventory/gui/GuiCoalGenerator.java | 2 +- .../inventory/gui/GuiCoffeeMachine.java | 2 +- .../inventory/gui/GuiEnergizer.java | 2 +- .../inventory/gui/GuiEnervator.java | 2 +- .../inventory/gui/GuiFurnaceDouble.java | 2 +- .../inventory/gui/GuiGrinder.java | 2 +- .../inventory/gui/GuiOilGenerator.java | 2 +- .../inventory/gui/GuiRepairer.java | 2 +- .../tile/TileEntityCanolaPress.java | 2 +- .../tile/TileEntityCoalGenerator.java | 3 ++- .../tile/TileEntityCoffeeMachine.java | 2 +- .../tile/TileEntityEnergizer.java | 2 +- .../tile/TileEntityEnervator.java | 2 +- .../tile/TileEntityFurnaceDouble.java | 3 ++- .../actuallyadditions/tile/TileEntityGrinder.java | 3 ++- .../tile/TileEntityItemRepairer.java | 2 +- .../tile/TileEntityOilGenerator.java | 3 ++- .../java/ellpeck/actuallyadditions/util/Util.java | 4 +--- 26 files changed, 48 insertions(+), 53 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCanolaPress.java index 4807e9e9e..199dde850 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCanolaPress.java @@ -16,7 +16,6 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @InventoryContainer @@ -53,7 +52,7 @@ public class ContainerCanolaPress extends Container{ @Override public void addCraftingToCrafters(ICrafting iCraft){ super.addCraftingToCrafters(iCraft); - iCraft.sendProgressBarUpdate(this, 0, this.press.getEnergyStored(ForgeDirection.UNKNOWN)); + iCraft.sendProgressBarUpdate(this, 0, this.press.storage.getEnergyStored()); iCraft.sendProgressBarUpdate(this, 1, this.press.tank.getFluidAmount()); iCraft.sendProgressBarUpdate(this, 2, this.press.currentProcessTime); } @@ -64,12 +63,12 @@ public class ContainerCanolaPress extends Container{ for(Object crafter : this.crafters){ ICrafting iCraft = (ICrafting)crafter; - if(this.lastEnergyStored != this.press.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.press.getEnergyStored(ForgeDirection.UNKNOWN)); + if(this.lastEnergyStored != this.press.storage.getEnergyStored()) iCraft.sendProgressBarUpdate(this, 0, this.press.storage.getEnergyStored()); if(this.lastTankAmount != this.press.tank.getFluidAmount()) iCraft.sendProgressBarUpdate(this, 1, this.press.tank.getFluidAmount()); if(this.lastProcessTime != this.press.currentProcessTime) iCraft.sendProgressBarUpdate(this, 2, this.press.currentProcessTime); } - this.lastEnergyStored = this.press.getEnergyStored(ForgeDirection.UNKNOWN); + this.lastEnergyStored = this.press.storage.getEnergyStored(); this.lastTankAmount = this.press.tank.getFluidAmount(); this.lastProcessTime = this.press.currentProcessTime; } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoalGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoalGenerator.java index 8f92656c2..87dce8942 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoalGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoalGenerator.java @@ -12,7 +12,6 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraftforge.common.util.ForgeDirection; @InventoryContainer public class ContainerCoalGenerator extends Container{ @@ -46,7 +45,7 @@ public class ContainerCoalGenerator extends Container{ @Override public void addCraftingToCrafters(ICrafting iCraft){ super.addCraftingToCrafters(iCraft); - iCraft.sendProgressBarUpdate(this, 0, this.generator.getEnergyStored(ForgeDirection.UNKNOWN)); + iCraft.sendProgressBarUpdate(this, 0, this.generator.storage.getEnergyStored()); iCraft.sendProgressBarUpdate(this, 1, this.generator.currentBurnTime); iCraft.sendProgressBarUpdate(this, 2, this.generator.maxBurnTime); } @@ -57,12 +56,12 @@ public class ContainerCoalGenerator extends Container{ for(Object crafter : this.crafters){ ICrafting iCraft = (ICrafting)crafter; - if(this.lastEnergyStored != this.generator.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.generator.getEnergyStored(ForgeDirection.UNKNOWN)); + if(this.lastEnergyStored != this.generator.storage.getEnergyStored()) iCraft.sendProgressBarUpdate(this, 0, this.generator.storage.getEnergyStored()); if(this.lastBurnTime != this.generator.currentBurnTime) iCraft.sendProgressBarUpdate(this, 1, this.generator.currentBurnTime); if(this.lastMaxBurnTime != this.generator.maxBurnTime) iCraft.sendProgressBarUpdate(this, 2, this.generator.maxBurnTime); } - this.lastEnergyStored = this.generator.getEnergyStored(ForgeDirection.UNKNOWN); + this.lastEnergyStored = this.generator.storage.getEnergyStored(); this.lastBurnTime = this.generator.currentBurnTime; this.lastMaxBurnTime = this.generator.maxBurnTime; } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnergizer.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnergizer.java index fd54376ef..63c213cdf 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnergizer.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnergizer.java @@ -13,7 +13,6 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; @InventoryContainer public class ContainerEnergizer extends Container{ @@ -46,7 +45,7 @@ public class ContainerEnergizer extends Container{ @Override public void addCraftingToCrafters(ICrafting iCraft){ super.addCraftingToCrafters(iCraft); - iCraft.sendProgressBarUpdate(this, 0, this.energizer.getEnergyStored(ForgeDirection.UNKNOWN)); + iCraft.sendProgressBarUpdate(this, 0, this.energizer.storage.getEnergyStored()); } @Override @@ -55,10 +54,10 @@ public class ContainerEnergizer extends Container{ for(Object crafter : this.crafters){ ICrafting iCraft = (ICrafting)crafter; - if(this.lastEnergyStored != this.energizer.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.energizer.getEnergyStored(ForgeDirection.UNKNOWN)); + if(this.lastEnergyStored != this.energizer.storage.getEnergyStored()) iCraft.sendProgressBarUpdate(this, 0, this.energizer.storage.getEnergyStored()); } - this.lastEnergyStored = this.energizer.getEnergyStored(ForgeDirection.UNKNOWN); + this.lastEnergyStored = this.energizer.storage.getEnergyStored(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnervator.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnervator.java index b9497be95..767d7fadf 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnervator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnervator.java @@ -13,7 +13,6 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; @InventoryContainer public class ContainerEnervator extends Container{ @@ -46,7 +45,7 @@ public class ContainerEnervator extends Container{ @Override public void addCraftingToCrafters(ICrafting iCraft){ super.addCraftingToCrafters(iCraft); - iCraft.sendProgressBarUpdate(this, 0, this.enervator.getEnergyStored(ForgeDirection.UNKNOWN)); + iCraft.sendProgressBarUpdate(this, 0, this.enervator.storage.getEnergyStored()); } @Override @@ -55,10 +54,10 @@ public class ContainerEnervator extends Container{ for(Object crafter : this.crafters){ ICrafting iCraft = (ICrafting)crafter; - if(this.lastEnergyStored != this.enervator.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.enervator.getEnergyStored(ForgeDirection.UNKNOWN)); + if(this.lastEnergyStored != this.enervator.storage.getEnergyStored()) iCraft.sendProgressBarUpdate(this, 0, this.enervator.storage.getEnergyStored()); } - this.lastEnergyStored = this.enervator.getEnergyStored(ForgeDirection.UNKNOWN); + this.lastEnergyStored = this.enervator.storage.getEnergyStored(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java index c366b63a3..9cbf2a7fc 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java @@ -13,7 +13,6 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; @InventoryContainer public class ContainerGrinder extends Container{ @@ -54,8 +53,8 @@ public class ContainerGrinder extends Container{ super.addCraftingToCrafters(iCraft); iCraft.sendProgressBarUpdate(this, 0, this.tileGrinder.firstCrushTime); iCraft.sendProgressBarUpdate(this, 1, this.tileGrinder.maxCrushTime); - if(this.isDouble) iCraft.sendProgressBarUpdate(this, 2, this.tileGrinder.secondCrushTime); - iCraft.sendProgressBarUpdate(this, 3, this.tileGrinder.getEnergyStored(ForgeDirection.UNKNOWN)); + iCraft.sendProgressBarUpdate(this, 2, this.tileGrinder.storage.getEnergyStored()); + if(this.isDouble) iCraft.sendProgressBarUpdate(this, 3, this.tileGrinder.secondCrushTime); } @Override @@ -66,14 +65,14 @@ public class ContainerGrinder extends Container{ if(this.lastFirstCrushTime != this.tileGrinder.firstCrushTime) iCraft.sendProgressBarUpdate(this, 0, this.tileGrinder.firstCrushTime); if(this.lastMaxCrushTime != this.tileGrinder.maxCrushTime) iCraft.sendProgressBarUpdate(this, 1, this.tileGrinder.maxCrushTime); - if(this.isDouble) if(this.lastSecondCrushTime != this.tileGrinder.secondCrushTime) iCraft.sendProgressBarUpdate(this, 2, this.tileGrinder.secondCrushTime); - if(this.lastEnergyStored != this.tileGrinder.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 3, this.tileGrinder.getEnergyStored(ForgeDirection.UNKNOWN)); + if(this.lastEnergyStored != this.tileGrinder.storage.getEnergyStored()) iCraft.sendProgressBarUpdate(this, 2, this.tileGrinder.storage.getEnergyStored()); + if(this.isDouble) if(this.lastSecondCrushTime != this.tileGrinder.secondCrushTime) iCraft.sendProgressBarUpdate(this, 3, this.tileGrinder.secondCrushTime); } this.lastFirstCrushTime = this.tileGrinder.firstCrushTime; this.lastMaxCrushTime = this.tileGrinder.maxCrushTime; + this.lastEnergyStored = this.tileGrinder.storage.getEnergyStored(); if(this.isDouble) this.lastSecondCrushTime = this.tileGrinder.secondCrushTime; - this.lastEnergyStored = this.tileGrinder.getEnergyStored(ForgeDirection.UNKNOWN); } @Override @@ -81,8 +80,8 @@ public class ContainerGrinder extends Container{ public void updateProgressBar(int par1, int par2){ if(par1 == 0) this.tileGrinder.firstCrushTime = par2; if(par1 == 1) this.tileGrinder.maxCrushTime = par2; - if(this.isDouble && par1 == 2) this.tileGrinder.secondCrushTime = par2; - if(par1 == 3) this.tileGrinder.storage.setEnergyStored(par2); + if(par1 == 2) this.tileGrinder.storage.setEnergyStored(par2); + if(this.isDouble && par1 == 3) this.tileGrinder.secondCrushTime = par2; } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java index b367c9d33..1dcd9e998 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java @@ -13,7 +13,6 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; @@ -50,7 +49,7 @@ public class ContainerOilGenerator extends Container{ @Override public void addCraftingToCrafters(ICrafting iCraft){ super.addCraftingToCrafters(iCraft); - iCraft.sendProgressBarUpdate(this, 0, this.generator.getEnergyStored(ForgeDirection.UNKNOWN)); + iCraft.sendProgressBarUpdate(this, 0, this.generator.storage.getEnergyStored()); iCraft.sendProgressBarUpdate(this, 1, this.generator.currentBurnTime); iCraft.sendProgressBarUpdate(this, 2, this.generator.tank.getFluidAmount()); } @@ -61,12 +60,12 @@ public class ContainerOilGenerator extends Container{ for(Object crafter : this.crafters){ ICrafting iCraft = (ICrafting)crafter; - if(this.lastEnergyStored != this.generator.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.generator.getEnergyStored(ForgeDirection.UNKNOWN)); + if(this.lastEnergyStored != this.generator.storage.getEnergyStored()) iCraft.sendProgressBarUpdate(this, 0, this.generator.storage.getEnergyStored()); if(this.lastBurnTime != this.generator.currentBurnTime) iCraft.sendProgressBarUpdate(this, 1, this.generator.currentBurnTime); if(this.lastTankAmount != this.generator.tank.getFluidAmount()) iCraft.sendProgressBarUpdate(this, 2, this.generator.tank.getFluidAmount()); } - this.lastEnergyStored = this.generator.getEnergyStored(ForgeDirection.UNKNOWN); + this.lastEnergyStored = this.generator.storage.getEnergyStored(); this.lastBurnTime = this.generator.currentBurnTime; this.lastTankAmount = this.generator.tank.getFluidAmount(); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerRepairer.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerRepairer.java index da2450df6..d83bb49bc 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerRepairer.java @@ -12,7 +12,6 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; @InventoryContainer public class ContainerRepairer extends Container{ @@ -40,7 +39,7 @@ public class ContainerRepairer extends Container{ @Override public void addCraftingToCrafters(ICrafting iCraft){ super.addCraftingToCrafters(iCraft); - iCraft.sendProgressBarUpdate(this, 0, this.tileRepairer.getEnergyStored(ForgeDirection.UNKNOWN)); + iCraft.sendProgressBarUpdate(this, 0, this.tileRepairer.storage.getEnergyStored()); } @Override @@ -49,10 +48,10 @@ public class ContainerRepairer extends Container{ for(Object crafter : this.crafters){ ICrafting iCraft = (ICrafting)crafter; - if(this.lastEnergy != this.tileRepairer.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.tileRepairer.getEnergyStored(ForgeDirection.UNKNOWN)); + if(this.lastEnergy != this.tileRepairer.storage.getEnergyStored()) iCraft.sendProgressBarUpdate(this, 0, this.tileRepairer.storage.getEnergyStored()); } - this.lastEnergy = this.tileRepairer.getEnergyStored(ForgeDirection.UNKNOWN); + this.lastEnergy = this.tileRepairer.storage.getEnergyStored(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java index bc5a498d3..e1faefd02 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java @@ -63,7 +63,7 @@ public class GuiCanolaPress extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.press.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.press.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF"; + String text1 = this.press.storage.getEnergyStored() + "/" + this.press.storage.getEnergyStored() + " RF"; if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoalGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoalGenerator.java index 17e60df8b..4aeb98b65 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoalGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoalGenerator.java @@ -57,7 +57,7 @@ public class GuiCoalGenerator extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.generator.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.generator.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF"; + String text1 = this.generator.storage.getEnergyStored() + "/" + this.generator.storage.getMaxEnergyStored() + " RF"; if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java index fb48794bd..da4ce43a8 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java @@ -101,7 +101,7 @@ public class GuiCoffeeMachine extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.machine.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.machine.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF"; + String text1 = this.machine.storage.getEnergyStored() + "/" + this.machine.storage.getEnergyStored() + " RF"; if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnergizer.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnergizer.java index 19cc34336..685aa1bfd 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnergizer.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnergizer.java @@ -52,7 +52,7 @@ public class GuiEnergizer extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.energizer.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.energizer.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF"; + String text1 = this.energizer.storage.getEnergyStored() + "/" + this.energizer.storage.getEnergyStored() + " RF"; if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnervator.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnervator.java index 215fe9909..800d72c70 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnervator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnervator.java @@ -52,7 +52,7 @@ public class GuiEnervator extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.enervator.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.enervator.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF"; + String text1 = this.enervator.storage.getEnergyStored() + "/" + this.enervator.storage.getMaxEnergyStored() + " RF"; if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFurnaceDouble.java index 96637d3f7..7092ba021 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFurnaceDouble.java @@ -59,7 +59,7 @@ public class GuiFurnaceDouble extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text = this.tileFurnace.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.tileFurnace.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF"; + String text = this.tileFurnace.storage.getEnergyStored() + "/" + this.tileFurnace.storage.getEnergyStored() + " RF"; if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java index bcbe38416..4150e45c9 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java @@ -64,7 +64,7 @@ public class GuiGrinder extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text = this.tileGrinder.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.tileGrinder.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF"; + String text = this.tileGrinder.storage.getEnergyStored() + "/" + this.tileGrinder.storage.getEnergyStored() + " RF"; if((this.isDouble && x >= guiLeft+14 && y >= guiTop+6 && x <= guiLeft+29 && y <= guiTop+88) || (!this.isDouble && x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88)){ this.func_146283_a(Collections.singletonList(text), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java index 7d0fe4bf2..73cbb3486 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java @@ -63,7 +63,7 @@ public class GuiOilGenerator extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.generator.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.generator.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF"; + String text1 = this.generator.storage.getEnergyStored() + "/" + this.generator.storage.getMaxEnergyStored() + " RF"; if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiRepairer.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiRepairer.java index 2cbb5e84a..9a14e1edb 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiRepairer.java @@ -55,7 +55,7 @@ public class GuiRepairer extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text = this.tileRepairer.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.tileRepairer.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF"; + String text = this.tileRepairer.storage.getEnergyStored() + "/" + this.tileRepairer.storage.getEnergyStored() + " RF"; if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java index 0efba8ae2..b941c70ed 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java @@ -76,7 +76,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.getEnergyStored(ForgeDirection.UNKNOWN) * i / this.getMaxEnergyStored(ForgeDirection.UNKNOWN); + return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoalGenerator.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoalGenerator.java index cad145cc6..4b06eb7da 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoalGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoalGenerator.java @@ -55,6 +55,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements } if(flag != this.currentBurnTime > 0){ + this.markDirty(); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if(meta == 1){ if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && energyProducedPerTick*TileEntityFurnace.getItemBurnTime(this.slots[0]) <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN))) @@ -67,7 +68,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.getEnergyStored(ForgeDirection.UNKNOWN) * i / this.getMaxEnergyStored(ForgeDirection.UNKNOWN); + return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java index 5fe50c06e..469bfc0ee 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java @@ -109,7 +109,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.getEnergyStored(ForgeDirection.UNKNOWN) * i / this.getMaxEnergyStored(ForgeDirection.UNKNOWN); + return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnergizer.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnergizer.java index 62f7d0f1d..70f41dd09 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnergizer.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnergizer.java @@ -59,7 +59,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.getEnergyStored(ForgeDirection.UNKNOWN) * i / this.getMaxEnergyStored(ForgeDirection.UNKNOWN); + return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnervator.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnervator.java index a26b71c78..14a68b47e 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnervator.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnervator.java @@ -79,7 +79,7 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.getEnergyStored(ForgeDirection.UNKNOWN) * i / this.getMaxEnergyStored(ForgeDirection.UNKNOWN); + return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceDouble.java index ccfc31aa1..3c8bb06ef 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceDouble.java @@ -65,6 +65,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements if(this.storage.getEnergyStored() >= energyUsePerTick && this.firstSmeltTime > 0 || this.secondSmeltTime > 0) this.storage.extractEnergy(energyUsePerTick, false); if(flag != (this.firstSmeltTime > 0 || this.secondSmeltTime > 0)){ + this.markDirty(); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if(meta > 3){ if(!this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1) && !this.canSmeltOn(SLOT_INPUT_2, SLOT_OUTPUT_2)) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta-4, 2); @@ -116,7 +117,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.getEnergyStored(ForgeDirection.UNKNOWN) * i / this.getMaxEnergyStored(ForgeDirection.UNKNOWN); + return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java index ec0f96379..db2d9e4b0 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java @@ -111,6 +111,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg if(this.storage.getEnergyStored() >= energyUsePerTick && this.firstCrushTime > 0 || this.secondCrushTime > 0) this.storage.extractEnergy(energyUsePerTick, false); if(flag != (this.firstCrushTime > 0 || this.secondCrushTime > 0)){ + this.markDirty(); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if(meta == 1){ if(!this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2) && (!this.isDouble || !this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2))) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); @@ -174,7 +175,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.getEnergyStored(ForgeDirection.UNKNOWN) * i / this.getMaxEnergyStored(ForgeDirection.UNKNOWN); + return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityItemRepairer.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityItemRepairer.java index 05dddf589..e0d9ef5a9 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityItemRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityItemRepairer.java @@ -71,7 +71,7 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.getEnergyStored(ForgeDirection.UNKNOWN) * i / this.getMaxEnergyStored(ForgeDirection.UNKNOWN); + return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java index 626bca499..f45b06b77 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java @@ -59,6 +59,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I } if(flag != this.currentBurnTime > 0){ + this.markDirty(); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if(meta == 1){ if(!(energyProducedPerTick*this.maxBurnTime <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN) && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount())) @@ -71,7 +72,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.getEnergyStored(ForgeDirection.UNKNOWN) * i / this.getMaxEnergyStored(ForgeDirection.UNKNOWN); + return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ellpeck/actuallyadditions/util/Util.java b/src/main/java/ellpeck/actuallyadditions/util/Util.java index b9f341485..fac7dc38a 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/Util.java +++ b/src/main/java/ellpeck/actuallyadditions/util/Util.java @@ -18,8 +18,6 @@ public class Util{ } public static void registerDispenserHandler(Item item, BehaviorDefaultDispenseItem handler){ - if(BlockDispenser.dispenseBehaviorRegistry.getObject(item) == null){ - BlockDispenser.dispenseBehaviorRegistry.putObject(item, handler); - } + BlockDispenser.dispenseBehaviorRegistry.putObject(item, handler); } } \ No newline at end of file