From bf4b74f535577b105983ac3684ef19c68798c279 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Thu, 19 Feb 2015 17:17:28 -0500 Subject: [PATCH] A few fixes --- .../java/mekanism/common/base/IFactory.java | 24 ++++++++++++------- .../TileEntityChemicalDissolutionChamber.java | 5 ++-- .../tile/TileEntityChemicalOxidizer.java | 2 +- .../common/tile/TileEntityChemicalWasher.java | 2 +- .../tile/TileEntityElectrolyticSeparator.java | 2 +- .../common/tile/TileEntityFactory.java | 15 ++++++++---- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/main/java/mekanism/common/base/IFactory.java b/src/main/java/mekanism/common/base/IFactory.java index 03b24a311..6bab9eecf 100644 --- a/src/main/java/mekanism/common/base/IFactory.java +++ b/src/main/java/mekanism/common/base/IFactory.java @@ -44,18 +44,19 @@ public interface IFactory public static enum RecipeType { - SMELTING("smelting", "smelter", MachineType.ENERGIZED_SMELTER.getStack(), false, Recipe.ENERGIZED_SMELTER), - ENRICHING("enriching", "enrichment", MachineType.ENRICHMENT_CHAMBER.getStack(), false, Recipe.ENRICHMENT_CHAMBER), - CRUSHING("crushing", "crusher", MachineType.CRUSHER.getStack(), false, Recipe.CRUSHER), - COMPRESSING("compressing", "compressor", MachineType.OSMIUM_COMPRESSOR.getStack(), true, Recipe.OSMIUM_COMPRESSOR), - COMBINING("combining", "combiner", MachineType.COMBINER.getStack(), true, Recipe.COMBINER), - PURIFYING("purifying", "purifier", MachineType.PURIFICATION_CHAMBER.getStack(), true, Recipe.PURIFICATION_CHAMBER), - INJECTING("injecting", "injection", MachineType.CHEMICAL_INJECTION_CHAMBER.getStack(), true, Recipe.CHEMICAL_INJECTION_CHAMBER); + SMELTING("smelting", "smelter", MachineType.ENERGIZED_SMELTER.getStack(), false, false, Recipe.ENERGIZED_SMELTER), + ENRICHING("enriching", "enrichment", MachineType.ENRICHMENT_CHAMBER.getStack(), false, false, Recipe.ENRICHMENT_CHAMBER), + CRUSHING("crushing", "crusher", MachineType.CRUSHER.getStack(), false, false, Recipe.CRUSHER), + COMPRESSING("compressing", "compressor", MachineType.OSMIUM_COMPRESSOR.getStack(), true, false, Recipe.OSMIUM_COMPRESSOR), + COMBINING("combining", "combiner", MachineType.COMBINER.getStack(), true, false, Recipe.COMBINER), + PURIFYING("purifying", "purifier", MachineType.PURIFICATION_CHAMBER.getStack(), true, true, Recipe.PURIFICATION_CHAMBER), + INJECTING("injecting", "injection", MachineType.CHEMICAL_INJECTION_CHAMBER.getStack(), true, true, Recipe.CHEMICAL_INJECTION_CHAMBER); private String name; private ResourceLocation sound; private ItemStack stack; private boolean usesFuel; + private boolean fuelSpeed; private Recipe recipe; private TileEntityAdvancedElectricMachine cacheTile; @@ -85,6 +86,7 @@ public interface IFactory { return getRecipe(slotStack,gasType); } + return getRecipe(slotStack); } @@ -198,13 +200,19 @@ public interface IFactory { return usesFuel; } + + public boolean fuelSpeedUpgrade() + { + return fuelSpeed; + } - private RecipeType(String s, String s1, ItemStack is, boolean b, Recipe r) + private RecipeType(String s, String s1, ItemStack is, boolean b, boolean b1, Recipe r) { name = s; sound = new ResourceLocation("mekanism", "tile.machine." + s1); stack = is; usesFuel = b; + fuelSpeed = b1; recipe = r; } } diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalDissolutionChamber.java b/src/main/java/mekanism/common/tile/TileEntityChemicalDissolutionChamber.java index 3e0e98a96..cfc6a1e29 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalDissolutionChamber.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalDissolutionChamber.java @@ -47,7 +47,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri public int updateDelay; - public int gasOutput = 16; + public int gasOutput = 256; public boolean isActive; @@ -461,8 +461,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri switch(upgrade) { case SPEED: - double toUse = MekanismUtils.getSecondaryEnergyPerTickMean(this, BASE_INJECT_USAGE); - injectUsage = StatUtils.inversePoisson((int)Math.ceil(toUse)); + injectUsage = StatUtils.inversePoisson(MekanismUtils.getSecondaryEnergyPerTickMean(this, BASE_INJECT_USAGE)); ticksRequired = MekanismUtils.getTicks(this, BASE_TICKS_REQUIRED); case ENERGY: energyUsage = MekanismUtils.getEnergyPerTick(this, BASE_ENERGY_USAGE); diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalOxidizer.java b/src/main/java/mekanism/common/tile/TileEntityChemicalOxidizer.java index 9da089444..55b7ae705 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalOxidizer.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalOxidizer.java @@ -42,7 +42,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp public int updateDelay; - public int gasOutput = 16; + public int gasOutput = 256; public boolean isActive; diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java b/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java index ab7691acc..3045a2299 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java @@ -59,7 +59,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple public int updateDelay; - public int gasOutput = 16; + public int gasOutput = 256; public boolean isActive; diff --git a/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java b/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java index a9f2c5ba8..6ffdb5987 100644 --- a/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java +++ b/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java @@ -65,7 +65,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp public GasTank rightTank = new GasTank(MAX_GAS); /** How fast this block can output gas. */ - public int output = 16; + public int output = 256; /** The type of gas this block is outputting. */ public boolean dumpLeft = false; diff --git a/src/main/java/mekanism/common/tile/TileEntityFactory.java b/src/main/java/mekanism/common/tile/TileEntityFactory.java index e0931df12..99f18daac 100644 --- a/src/main/java/mekanism/common/tile/TileEntityFactory.java +++ b/src/main/java/mekanism/common/tile/TileEntityFactory.java @@ -38,16 +38,13 @@ import mekanism.common.util.ChargeUtils; import mekanism.common.util.InventoryUtils; import mekanism.common.util.MekanismUtils; import mekanism.common.util.StatUtils; - import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; 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; @@ -367,8 +364,16 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I public int getSecondaryEnergyPerTick(RecipeType type) { - double toUse = MekanismUtils.getSecondaryEnergyPerTickMean(this, type.getSecondaryEnergyPerTick()); - return StatUtils.inversePoisson((int)Math.ceil(toUse)); + double secondaryToUse = type.getSecondaryEnergyPerTick(); + + if(type.fuelSpeedUpgrade()) + { + secondaryToUse = MekanismUtils.getSecondaryEnergyPerTickMean(this, type.getSecondaryEnergyPerTick()); + return StatUtils.inversePoisson(secondaryToUse); + } + else { + return (int)Math.ceil(secondaryToUse); + } } public void handleSecondaryFuel()