From b419519cc05a660f848244e3456230187507e7dd Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Wed, 18 Feb 2015 19:33:03 -0500 Subject: [PATCH] Chemical Infuser, Chemical Washer and Electrolytic Separator are now upgradeable --- .../client/gui/GuiChemicalInfuser.java | 11 ++- .../client/gui/GuiChemicalWasher.java | 2 +- .../client/gui/GuiElectrolyticSeparator.java | 11 ++- .../mekanism/common/block/BlockMachine.java | 2 +- .../mekanism/common/recipe/RecipeHandler.java | 4 +- .../recipe/machines/SeparatorRecipe.java | 8 +- .../recipe/outputs/ChemicalPairOutput.java | 20 +++-- .../tile/TileEntityChemicalInfuser.java | 61 ++++++++++++-- .../common/tile/TileEntityChemicalWasher.java | 18 +++-- .../tile/TileEntityElectrolyticSeparator.java | 79 +++++++++++++++---- 10 files changed, 166 insertions(+), 50 deletions(-) diff --git a/src/main/java/mekanism/client/gui/GuiChemicalInfuser.java b/src/main/java/mekanism/client/gui/GuiChemicalInfuser.java index 297796dc3..f1e8ba214 100644 --- a/src/main/java/mekanism/client/gui/GuiChemicalInfuser.java +++ b/src/main/java/mekanism/client/gui/GuiChemicalInfuser.java @@ -19,7 +19,6 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.tile.TileEntityChemicalInfuser; import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils.ResourceType; - import net.minecraft.entity.player.InventoryPlayer; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -37,11 +36,19 @@ public class GuiChemicalInfuser extends GuiMekanism tileEntity = tentity; guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"))); + guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"))); guiElements.add(new GuiEnergyInfo(new IInfoHandler() { @Override public List getInfo() { - String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE); + double usage = 0; + + if(tileEntity.getRecipe() != null) + { + usage = tileEntity.getUpgradedUsage(tileEntity.getRecipe())*tileEntity.BASE_ENERGY_USAGE; + } + + String multiplier = MekanismUtils.getEnergyDisplay(usage); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"))); diff --git a/src/main/java/mekanism/client/gui/GuiChemicalWasher.java b/src/main/java/mekanism/client/gui/GuiChemicalWasher.java index 30f650404..929c49c60 100644 --- a/src/main/java/mekanism/client/gui/GuiChemicalWasher.java +++ b/src/main/java/mekanism/client/gui/GuiChemicalWasher.java @@ -45,7 +45,7 @@ public class GuiChemicalWasher extends GuiMekanism @Override public List getInfo() { - String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyUsage); + String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.BASE_ENERGY_USAGE*tileEntity.getUpgradedUsage()); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"))); diff --git a/src/main/java/mekanism/client/gui/GuiElectrolyticSeparator.java b/src/main/java/mekanism/client/gui/GuiElectrolyticSeparator.java index f42aab5d7..9048b827f 100755 --- a/src/main/java/mekanism/client/gui/GuiElectrolyticSeparator.java +++ b/src/main/java/mekanism/client/gui/GuiElectrolyticSeparator.java @@ -21,7 +21,6 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.tile.TileEntityElectrolyticSeparator; import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils.ResourceType; - import net.minecraft.entity.player.InventoryPlayer; import net.minecraftforge.fluids.FluidTank; import cpw.mods.fml.relauncher.Side; @@ -40,11 +39,19 @@ public class GuiElectrolyticSeparator extends GuiMekanism tileEntity = tentity; + guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"))); guiElements.add(new GuiEnergyInfo(new IInfoHandler() { @Override public List getInfo() { - String multiplier = MekanismUtils.getEnergyDisplay(general.FROM_H2*2); + double usage = 0; + + if(tileEntity.getRecipe() != null) + { + usage = tileEntity.getUpgradedUsage(tileEntity.getRecipe())*tileEntity.getRecipe().extraEnergy; + } + + String multiplier = MekanismUtils.getEnergyDisplay(usage); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"))); diff --git a/src/main/java/mekanism/common/block/BlockMachine.java b/src/main/java/mekanism/common/block/BlockMachine.java index ee9b27260..b75fcfbe5 100644 --- a/src/main/java/mekanism/common/block/BlockMachine.java +++ b/src/main/java/mekanism/common/block/BlockMachine.java @@ -154,7 +154,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer { super(Material.iron); setHardness(3.5F); - setResistance(8F); + setResistance(16F); setCreativeTab(Mekanism.tabMekanism); blockType = type; } diff --git a/src/main/java/mekanism/common/recipe/RecipeHandler.java b/src/main/java/mekanism/common/recipe/RecipeHandler.java index 6386e2a5b..3d8d33b57 100644 --- a/src/main/java/mekanism/common/recipe/RecipeHandler.java +++ b/src/main/java/mekanism/common/recipe/RecipeHandler.java @@ -580,9 +580,9 @@ public final class RecipeHandler { Map.Entry entry = (Map.Entry)obj; - if(entry.getKey() instanceof FluidStack) + if(entry.getKey() instanceof FluidInput) { - if(((FluidStack)entry.getKey()).getFluid() == input) + if(((FluidInput)entry.getKey()).ingredient.getFluid() == input) { return true; } diff --git a/src/main/java/mekanism/common/recipe/machines/SeparatorRecipe.java b/src/main/java/mekanism/common/recipe/machines/SeparatorRecipe.java index ece3a9ed7..ac93e4477 100644 --- a/src/main/java/mekanism/common/recipe/machines/SeparatorRecipe.java +++ b/src/main/java/mekanism/common/recipe/machines/SeparatorRecipe.java @@ -31,14 +31,14 @@ public class SeparatorRecipe extends MachineRecipe return new ChemicalPairOutput(rightGas, leftGas); } - public boolean applyOutputs(GasTank leftTank, GasTank rightTank, boolean doEmit) + public boolean applyOutputs(GasTank leftTank, GasTank rightTank, boolean doEmit, int scale) { if(leftTank.canReceive(leftGas.getGas()) && rightTank.canReceive(rightGas.getGas())) { - if(leftTank.getNeeded() >= leftGas.amount && rightTank.getNeeded() >= rightGas.amount) + if(leftTank.getNeeded() >= leftGas.amount*scale && rightTank.getNeeded() >= rightGas.amount*scale) { - leftTank.receive(leftGas, doEmit); - rightTank.receive(rightGas, doEmit); + leftTank.receive(leftGas.copy().withAmount(leftGas.amount*scale), doEmit); + rightTank.receive(rightGas.copy().withAmount(rightGas.amount*scale), doEmit); + return true; } - } else if(leftTank.canReceive(rightGas.getGas()) && rightTank.canReceive(leftGas.getGas())) + } + else if(leftTank.canReceive(rightGas.getGas()) && rightTank.canReceive(leftGas.getGas())) { - if(leftTank.getNeeded() >= rightGas.amount && rightTank.getNeeded() >= leftGas.amount) + if(leftTank.getNeeded() >= rightGas.amount*scale && rightTank.getNeeded() >= leftGas.amount*scale) { - leftTank.receive(rightGas, doEmit); - rightTank.receive(leftGas, doEmit); + leftTank.receive(rightGas.copy().withAmount(rightGas.amount*scale), doEmit); + rightTank.receive(leftGas.copy().withAmount(leftGas.amount*scale), doEmit); + return true; } } + return false; } diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalInfuser.java b/src/main/java/mekanism/common/tile/TileEntityChemicalInfuser.java index bfedceb8b..b52394abf 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalInfuser.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalInfuser.java @@ -1,5 +1,7 @@ package mekanism.common.tile; +import io.netty.buffer.ByteBuf; + import java.util.ArrayList; import mekanism.api.Coord4D; @@ -14,17 +16,19 @@ import mekanism.api.gas.IGasHandler; import mekanism.api.gas.IGasItem; import mekanism.api.gas.ITubeConnection; import mekanism.common.Mekanism; +import mekanism.common.Upgrade; import mekanism.common.base.IRedstoneControl; import mekanism.common.base.ISustainedData; +import mekanism.common.base.IUpgradeTile; import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.recipe.RecipeHandler; import mekanism.common.recipe.inputs.ChemicalPairInput; import mekanism.common.recipe.machines.ChemicalInfuserRecipe; +import mekanism.common.tile.component.TileComponentUpgrade; import mekanism.common.util.ChargeUtils; import mekanism.common.util.InventoryUtils; import mekanism.common.util.MekanismUtils; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; @@ -32,9 +36,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import io.netty.buffer.ByteBuf; - -public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISustainedData +public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISustainedData, IUpgradeTile { public GasTank leftTank = new GasTank(MAX_GAS); public GasTank rightTank = new GasTank(MAX_GAS); @@ -52,9 +54,11 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl public double prevEnergy; - public final double ENERGY_USAGE = usage.chemicalInfuserUsage; + public final double BASE_ENERGY_USAGE = usage.chemicalInfuserUsage; public ChemicalInfuserRecipe cachedRecipe; + + public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 4); /** This machine's current RedstoneControl type. */ public RedstoneControl controlType = RedstoneControl.DISABLED; @@ -62,7 +66,7 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl public TileEntityChemicalInfuser() { super("machine.cheminfuser", "ChemicalInfuser", MachineType.CHEMICAL_INFUSER.baseEnergy); - inventory = new ItemStack[4]; + inventory = new ItemStack[5]; } @Override @@ -110,10 +114,10 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl centerTank.draw(GasTransmission.addGas(inventory[2], centerTank.getGas()), true); } - if(canOperate(recipe) && getEnergy() >= ENERGY_USAGE && MekanismUtils.canFunction(this)) + if(canOperate(recipe) && getEnergy() >= BASE_ENERGY_USAGE && MekanismUtils.canFunction(this)) { setActive(true); - setEnergy(getEnergy() - ENERGY_USAGE); + setEnergy(getEnergy() - BASE_ENERGY_USAGE); operate(recipe); } @@ -142,6 +146,27 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl prevEnergy = getEnergy(); } } + + public int getUpgradedUsage(ChemicalInfuserRecipe recipe) + { + int possibleProcess = 0; + + if(leftTank.getGasType() == recipe.recipeInput.leftGas.getGas()) + { + possibleProcess = leftTank.getStored()/recipe.recipeInput.leftGas.amount; + possibleProcess = Math.min(rightTank.getStored()/recipe.recipeInput.rightGas.amount, possibleProcess); + } + else { + possibleProcess = leftTank.getStored()/recipe.recipeInput.rightGas.amount; + possibleProcess = Math.min(rightTank.getStored()/recipe.recipeInput.leftGas.amount, possibleProcess); + } + + possibleProcess = Math.min(centerTank.getNeeded()/recipe.recipeOutput.output.amount, possibleProcess); + possibleProcess = Math.min((int)Math.pow(2, upgradeComponent.getUpgrades(Upgrade.SPEED)), possibleProcess); + possibleProcess = Math.min((int)(getEnergy()/BASE_ENERGY_USAGE), possibleProcess); + + return possibleProcess; + } public ChemicalPairInput getInput() { @@ -151,10 +176,12 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl public ChemicalInfuserRecipe getRecipe() { ChemicalPairInput input = getInput(); + if(cachedRecipe == null || !input.testEquality(cachedRecipe.getInput())) { cachedRecipe = RecipeHandler.getChemicalInfuserRecipe(getInput()); } + return cachedRecipe; } @@ -488,4 +515,22 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl rightTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("rightTank"))); centerTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("centerTank"))); } + + @Override + public TileComponentUpgrade getComponent() + { + return upgradeComponent; + } + + @Override + public void recalculateUpgradables(Upgrade upgrade) + { + super.recalculateUpgradables(upgrade); + + switch(upgrade) + { + case ENERGY: + maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY); + } + } } diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java b/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java index 356ed0763..ab7691acc 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java @@ -68,8 +68,6 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple public double prevEnergy; public final double BASE_ENERGY_USAGE = usage.chemicalWasherUsage; - - public double energyUsage = usage.chemicalWasherUsage; public WasherRecipe cachedRecipe; @@ -120,13 +118,13 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple outputTank.draw(GasTransmission.addGas(inventory[2], outputTank.getGas()), true); } - if(canOperate(recipe) && getEnergy() >= energyUsage && MekanismUtils.canFunction(this)) + if(canOperate(recipe) && getEnergy() >= BASE_ENERGY_USAGE && MekanismUtils.canFunction(this)) { setActive(true); - operate(recipe); + int operations = operate(recipe); - setEnergy(getEnergy() - energyUsage); + setEnergy(getEnergy() - BASE_ENERGY_USAGE*operations); } else { if(prevEnergy >= getEnergy()) @@ -176,9 +174,13 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple return recipe != null && recipe.canOperate(inputTank, fluidTank, outputTank); } - public void operate(WasherRecipe recipe) + public int operate(WasherRecipe recipe) { - recipe.operate(inputTank, fluidTank, outputTank, getUpgradedUsage()); + int operations = getUpgradedUsage(); + + recipe.operate(inputTank, fluidTank, outputTank, operations); + + return operations; } private void manageBuckets() @@ -257,6 +259,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple { int possibleProcess = Math.min(inputTank.getStored(), outputTank.getNeeded()); possibleProcess = Math.min((int)Math.pow(2, upgradeComponent.getUpgrades(Upgrade.SPEED)), possibleProcess); + possibleProcess = Math.min((int)(getEnergy()/BASE_ENERGY_USAGE), possibleProcess); return Math.min(fluidTank.getFluidAmount()/WATER_USAGE, possibleProcess); } @@ -643,7 +646,6 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple switch(upgrade) { case ENERGY: - energyUsage = MekanismUtils.getEnergyPerTick(this, BASE_ENERGY_USAGE); maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY); } } diff --git a/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java b/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java index a0723692c..a9f2c5ba8 100644 --- a/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java +++ b/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java @@ -1,5 +1,7 @@ package mekanism.common.tile; +import io.netty.buffer.ByteBuf; + import java.util.ArrayList; import mekanism.api.Coord4D; @@ -13,7 +15,9 @@ import mekanism.api.gas.IGasHandler; import mekanism.api.gas.IGasItem; import mekanism.api.gas.ITubeConnection; import mekanism.common.Mekanism; +import mekanism.common.Upgrade; import mekanism.common.base.ISustainedData; +import mekanism.common.base.IUpgradeTile; import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.recipe.RecipeHandler; @@ -21,11 +25,11 @@ import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.FluidInput; import mekanism.common.recipe.machines.SeparatorRecipe; import mekanism.common.recipe.outputs.ChemicalPairOutput; +import mekanism.common.tile.component.TileComponentUpgrade; import mekanism.common.util.ChargeUtils; import mekanism.common.util.FluidContainerUtils; import mekanism.common.util.InventoryUtils; import mekanism.common.util.MekanismUtils; - import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -40,16 +44,13 @@ import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidHandler; import cpw.mods.fml.common.Optional.Interface; import cpw.mods.fml.common.Optional.Method; - -import io.netty.buffer.ByteBuf; - import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; @Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") -public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock implements IFluidHandler, IPeripheral, ITubeConnection, ISustainedData, IGasHandler +public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock implements IFluidHandler, IPeripheral, ITubeConnection, ISustainedData, IGasHandler, IUpgradeTile { /** This separator's water slot. */ public FluidTank fluidTank = new FluidTank(24000); @@ -75,11 +76,13 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp public boolean isActive = false; public SeparatorRecipe cachedRecipe; + + public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 4); public TileEntityElectrolyticSeparator() { super("ElectrolyticSeparator", MachineType.ELECTROLYTIC_SEPARATOR.baseEnergy); - inventory = new ItemStack[4]; + inventory = new ItemStack[5]; } @Override @@ -140,12 +143,16 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp if(canOperate(recipe) && getEnergy() >= recipe.extraEnergy) { setActive(true); - operate(recipe); - setEnergy(getEnergy() - recipe.extraEnergy); + + int operations = operate(recipe); + + setEnergy(getEnergy() - recipe.extraEnergy*operations); } else { setActive(false); } + + int dumpAmount = 8*(int)Math.pow(2, upgradeComponent.getUpgrades(Upgrade.SPEED)); if(leftTank.getGas() != null) { @@ -164,7 +171,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp } } else { - leftTank.draw(8, true); + leftTank.draw(dumpAmount, true); if(worldObj.rand.nextInt(3) == 2) { @@ -190,7 +197,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp } } else { - rightTank.draw(8, true); + rightTank.draw(dumpAmount, true); if(worldObj.rand.nextInt(3) == 2) { @@ -201,14 +208,36 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp } } + + public int getUpgradedUsage(SeparatorRecipe recipe) + { + int possibleProcess = 0; + + if(leftTank.getGasType() == recipe.recipeOutput.leftGas.getGas()) + { + possibleProcess = leftTank.getNeeded()/recipe.recipeOutput.leftGas.amount; + possibleProcess = Math.min(rightTank.getNeeded()/recipe.recipeOutput.rightGas.amount, possibleProcess); + } + else { + possibleProcess = leftTank.getNeeded()/recipe.recipeOutput.rightGas.amount; + possibleProcess = Math.min(rightTank.getNeeded()/recipe.recipeOutput.leftGas.amount, possibleProcess); + } + + possibleProcess = Math.min((int)Math.pow(2, upgradeComponent.getUpgrades(Upgrade.SPEED)), possibleProcess); + possibleProcess = Math.min((int)(getEnergy()/recipe.extraEnergy), possibleProcess); + + return Math.min(fluidTank.getFluidAmount()/recipe.recipeInput.ingredient.amount, possibleProcess); + } public SeparatorRecipe getRecipe() { FluidInput input = getInput(); + if(cachedRecipe == null || !input.testEquality(cachedRecipe.getInput())) { cachedRecipe = RecipeHandler.getElectrolyticSeparatorRecipe(getInput()); } + return cachedRecipe; } @@ -222,9 +251,13 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp return recipe != null && recipe.canOperate(fluidTank, leftTank, rightTank); } - public void operate(SeparatorRecipe recipe) + public int operate(SeparatorRecipe recipe) { - recipe.operate(fluidTank, leftTank, rightTank); + int operations = getUpgradedUsage(recipe); + + recipe.operate(fluidTank, leftTank, rightTank, operations); + + return operations; } public boolean canFill(ChemicalPairOutput gases) @@ -581,7 +614,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp @Override public boolean canFill(ForgeDirection from, Fluid fluid) { - return RecipeHandler.Recipe.ELECTROLYTIC_SEPARATOR.containsRecipe(fluid); + return Recipe.ELECTROLYTIC_SEPARATOR.containsRecipe(fluid); } @Override @@ -593,7 +626,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { - if(RecipeHandler.Recipe.ELECTROLYTIC_SEPARATOR.containsRecipe(resource.getFluid())) + if(Recipe.ELECTROLYTIC_SEPARATOR.containsRecipe(resource.getFluid())) { return fluidTank.fill(resource, doFill); } @@ -659,4 +692,22 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp { isActive = active; } + + @Override + public TileComponentUpgrade getComponent() + { + return upgradeComponent; + } + + @Override + public void recalculateUpgradables(Upgrade upgrade) + { + super.recalculateUpgradables(upgrade); + + switch(upgrade) + { + case ENERGY: + maxEnergy = MekanismUtils.getMaxEnergy(this, BASE_MAX_ENERGY); + } + } }