From 9acc2647261c2af63c84fd19b8f1edfb22456b71 Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Thu, 16 Jan 2014 20:50:59 -0500 Subject: [PATCH] A few fixes --- .../common/tile/TileEntityAdvancedElectricMachine.java | 4 ++-- common/mekanism/common/tile/TileEntityFactory.java | 9 ++------- .../common/tile/TileEntitySalinationController.java | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/common/mekanism/common/tile/TileEntityAdvancedElectricMachine.java b/common/mekanism/common/tile/TileEntityAdvancedElectricMachine.java index bd5f55b6e..54c8d8f33 100644 --- a/common/mekanism/common/tile/TileEntityAdvancedElectricMachine.java +++ b/common/mekanism/common/tile/TileEntityAdvancedElectricMachine.java @@ -31,7 +31,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM /** How much secondary energy (fuel) this machine uses per tick. */ public int SECONDARY_ENERGY_PER_TICK; - public int MAX_SECONDARY_ENERGY = 200; + public static int MAX_GAS = 200; public GasTank gasTank; @@ -62,7 +62,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM sideConfig = new byte[] {2, 1, 0, 4, 5, 3}; - gasTank = new GasTank(MAX_SECONDARY_ENERGY); + gasTank = new GasTank(MAX_GAS); inventory = new ItemStack[5]; diff --git a/common/mekanism/common/tile/TileEntityFactory.java b/common/mekanism/common/tile/TileEntityFactory.java index e24906b95..b82a7b5c8 100644 --- a/common/mekanism/common/tile/TileEntityFactory.java +++ b/common/mekanism/common/tile/TileEntityFactory.java @@ -117,7 +117,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip progress = new int[type.processes]; isActive = false; - gasTank = new GasTank(getMaxSecondaryEnergy()); + gasTank = new GasTank(TileEntityAdvancedElectricMachine.MAX_GAS*tier.processes); } @Override @@ -339,14 +339,9 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip return RecipeType.values()[recipeType].getSecondaryEnergyPerTick(); } - public int getMaxSecondaryEnergy() - { - return RecipeType.values()[recipeType].getMaxSecondaryEnergy()*tier.processes; - } - public void handleSecondaryFuel() { - if(inventory[4] != null && RecipeType.values()[recipeType].usesFuel() && gasTank.getStored() < getMaxSecondaryEnergy()) + if(inventory[4] != null && RecipeType.values()[recipeType].usesFuel() && gasTank.getNeeded() > 0) { if(recipeType == RecipeType.PURIFYING.ordinal()) { diff --git a/common/mekanism/common/tile/TileEntitySalinationController.java b/common/mekanism/common/tile/TileEntitySalinationController.java index 0fd1186ac..92475ad57 100644 --- a/common/mekanism/common/tile/TileEntitySalinationController.java +++ b/common/mekanism/common/tile/TileEntitySalinationController.java @@ -583,7 +583,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp public int getScaledWaterLevel(int i) { - return waterTank.getFluid() != null ? waterTank.getFluid().amount*i / getMaxWater() : 0; + return getMaxWater() > 0 ? (waterTank.getFluid() != null ? waterTank.getFluid().amount*i / getMaxWater() : 0) : 0; } public int getScaledBrineLevel(int i)