A few fixes

This commit is contained in:
Aidan C. Brady 2015-02-19 17:17:28 -05:00
parent a9a506fe4a
commit bf4b74f535
6 changed files with 31 additions and 19 deletions

View file

@ -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);
}
@ -199,12 +201,18 @@ public interface IFactory
return usesFuel;
}
private RecipeType(String s, String s1, ItemStack is, boolean b, Recipe r)
public boolean fuelSpeedUpgrade()
{
return fuelSpeed;
}
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;
}
}

View file

@ -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);

View file

@ -42,7 +42,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
public int updateDelay;
public int gasOutput = 16;
public int gasOutput = 256;
public boolean isActive;

View file

@ -59,7 +59,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
public int updateDelay;
public int gasOutput = 16;
public int gasOutput = 256;
public boolean isActive;

View file

@ -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;

View file

@ -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()