A few fixes
This commit is contained in:
parent
a9a506fe4a
commit
bf4b74f535
6 changed files with 31 additions and 19 deletions
|
@ -44,18 +44,19 @@ public interface IFactory
|
||||||
|
|
||||||
public static enum RecipeType
|
public static enum RecipeType
|
||||||
{
|
{
|
||||||
SMELTING("smelting", "smelter", MachineType.ENERGIZED_SMELTER.getStack(), false, Recipe.ENERGIZED_SMELTER),
|
SMELTING("smelting", "smelter", MachineType.ENERGIZED_SMELTER.getStack(), false, false, Recipe.ENERGIZED_SMELTER),
|
||||||
ENRICHING("enriching", "enrichment", MachineType.ENRICHMENT_CHAMBER.getStack(), false, Recipe.ENRICHMENT_CHAMBER),
|
ENRICHING("enriching", "enrichment", MachineType.ENRICHMENT_CHAMBER.getStack(), false, false, Recipe.ENRICHMENT_CHAMBER),
|
||||||
CRUSHING("crushing", "crusher", MachineType.CRUSHER.getStack(), false, Recipe.CRUSHER),
|
CRUSHING("crushing", "crusher", MachineType.CRUSHER.getStack(), false, false, Recipe.CRUSHER),
|
||||||
COMPRESSING("compressing", "compressor", MachineType.OSMIUM_COMPRESSOR.getStack(), true, Recipe.OSMIUM_COMPRESSOR),
|
COMPRESSING("compressing", "compressor", MachineType.OSMIUM_COMPRESSOR.getStack(), true, false, Recipe.OSMIUM_COMPRESSOR),
|
||||||
COMBINING("combining", "combiner", MachineType.COMBINER.getStack(), true, Recipe.COMBINER),
|
COMBINING("combining", "combiner", MachineType.COMBINER.getStack(), true, false, Recipe.COMBINER),
|
||||||
PURIFYING("purifying", "purifier", MachineType.PURIFICATION_CHAMBER.getStack(), true, Recipe.PURIFICATION_CHAMBER),
|
PURIFYING("purifying", "purifier", MachineType.PURIFICATION_CHAMBER.getStack(), true, true, Recipe.PURIFICATION_CHAMBER),
|
||||||
INJECTING("injecting", "injection", MachineType.CHEMICAL_INJECTION_CHAMBER.getStack(), true, Recipe.CHEMICAL_INJECTION_CHAMBER);
|
INJECTING("injecting", "injection", MachineType.CHEMICAL_INJECTION_CHAMBER.getStack(), true, true, Recipe.CHEMICAL_INJECTION_CHAMBER);
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private ResourceLocation sound;
|
private ResourceLocation sound;
|
||||||
private ItemStack stack;
|
private ItemStack stack;
|
||||||
private boolean usesFuel;
|
private boolean usesFuel;
|
||||||
|
private boolean fuelSpeed;
|
||||||
private Recipe recipe;
|
private Recipe recipe;
|
||||||
private TileEntityAdvancedElectricMachine cacheTile;
|
private TileEntityAdvancedElectricMachine cacheTile;
|
||||||
|
|
||||||
|
@ -85,6 +86,7 @@ public interface IFactory
|
||||||
{
|
{
|
||||||
return getRecipe(slotStack,gasType);
|
return getRecipe(slotStack,gasType);
|
||||||
}
|
}
|
||||||
|
|
||||||
return getRecipe(slotStack);
|
return getRecipe(slotStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,13 +200,19 @@ public interface IFactory
|
||||||
{
|
{
|
||||||
return usesFuel;
|
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;
|
name = s;
|
||||||
sound = new ResourceLocation("mekanism", "tile.machine." + s1);
|
sound = new ResourceLocation("mekanism", "tile.machine." + s1);
|
||||||
stack = is;
|
stack = is;
|
||||||
usesFuel = b;
|
usesFuel = b;
|
||||||
|
fuelSpeed = b1;
|
||||||
recipe = r;
|
recipe = r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
||||||
|
|
||||||
public int updateDelay;
|
public int updateDelay;
|
||||||
|
|
||||||
public int gasOutput = 16;
|
public int gasOutput = 256;
|
||||||
|
|
||||||
public boolean isActive;
|
public boolean isActive;
|
||||||
|
|
||||||
|
@ -461,8 +461,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
||||||
switch(upgrade)
|
switch(upgrade)
|
||||||
{
|
{
|
||||||
case SPEED:
|
case SPEED:
|
||||||
double toUse = MekanismUtils.getSecondaryEnergyPerTickMean(this, BASE_INJECT_USAGE);
|
injectUsage = StatUtils.inversePoisson(MekanismUtils.getSecondaryEnergyPerTickMean(this, BASE_INJECT_USAGE));
|
||||||
injectUsage = StatUtils.inversePoisson((int)Math.ceil(toUse));
|
|
||||||
ticksRequired = MekanismUtils.getTicks(this, BASE_TICKS_REQUIRED);
|
ticksRequired = MekanismUtils.getTicks(this, BASE_TICKS_REQUIRED);
|
||||||
case ENERGY:
|
case ENERGY:
|
||||||
energyUsage = MekanismUtils.getEnergyPerTick(this, BASE_ENERGY_USAGE);
|
energyUsage = MekanismUtils.getEnergyPerTick(this, BASE_ENERGY_USAGE);
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
||||||
|
|
||||||
public int updateDelay;
|
public int updateDelay;
|
||||||
|
|
||||||
public int gasOutput = 16;
|
public int gasOutput = 256;
|
||||||
|
|
||||||
public boolean isActive;
|
public boolean isActive;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
||||||
|
|
||||||
public int updateDelay;
|
public int updateDelay;
|
||||||
|
|
||||||
public int gasOutput = 16;
|
public int gasOutput = 256;
|
||||||
|
|
||||||
public boolean isActive;
|
public boolean isActive;
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||||
public GasTank rightTank = new GasTank(MAX_GAS);
|
public GasTank rightTank = new GasTank(MAX_GAS);
|
||||||
|
|
||||||
/** How fast this block can output gas. */
|
/** How fast this block can output gas. */
|
||||||
public int output = 16;
|
public int output = 256;
|
||||||
|
|
||||||
/** The type of gas this block is outputting. */
|
/** The type of gas this block is outputting. */
|
||||||
public boolean dumpLeft = false;
|
public boolean dumpLeft = false;
|
||||||
|
|
|
@ -38,16 +38,13 @@ import mekanism.common.util.ChargeUtils;
|
||||||
import mekanism.common.util.InventoryUtils;
|
import mekanism.common.util.InventoryUtils;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
import mekanism.common.util.StatUtils;
|
import mekanism.common.util.StatUtils;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import cpw.mods.fml.common.Optional.Interface;
|
import cpw.mods.fml.common.Optional.Interface;
|
||||||
import cpw.mods.fml.common.Optional.Method;
|
import cpw.mods.fml.common.Optional.Method;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
import dan200.computercraft.api.lua.ILuaContext;
|
import dan200.computercraft.api.lua.ILuaContext;
|
||||||
import dan200.computercraft.api.lua.LuaException;
|
import dan200.computercraft.api.lua.LuaException;
|
||||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||||
|
@ -367,8 +364,16 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||||
|
|
||||||
public int getSecondaryEnergyPerTick(RecipeType type)
|
public int getSecondaryEnergyPerTick(RecipeType type)
|
||||||
{
|
{
|
||||||
double toUse = MekanismUtils.getSecondaryEnergyPerTickMean(this, type.getSecondaryEnergyPerTick());
|
double secondaryToUse = type.getSecondaryEnergyPerTick();
|
||||||
return StatUtils.inversePoisson((int)Math.ceil(toUse));
|
|
||||||
|
if(type.fuelSpeedUpgrade())
|
||||||
|
{
|
||||||
|
secondaryToUse = MekanismUtils.getSecondaryEnergyPerTickMean(this, type.getSecondaryEnergyPerTick());
|
||||||
|
return StatUtils.inversePoisson(secondaryToUse);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (int)Math.ceil(secondaryToUse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleSecondaryFuel()
|
public void handleSecondaryFuel()
|
||||||
|
|
Loading…
Reference in a new issue