Even up hydrogen consumption and generation.

This commit is contained in:
Ben Spiers 2014-04-04 01:01:54 +01:00
parent 1298d544d5
commit d0c87e862a
8 changed files with 10 additions and 13 deletions

View file

@ -37,7 +37,7 @@ public class GuiElectrolyticSeparator extends GuiMekanism
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(Mekanism.electrolyticSeparatorUsage);
String multiplier = MekanismUtils.getEnergyDisplay(Mekanism.FROM_H2*2);
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png")));

View file

@ -209,6 +209,7 @@ public class CommonProxy
Mekanism.TO_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EUToJoules", .1D).getDouble(.1D);
Mekanism.FROM_BC = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToMJ", 25D).getDouble(25D);
Mekanism.TO_BC = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MJToJoules", .04D).getDouble(.04D);
Mekanism.FROM_H2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HydrogenEnergyDensity", 200D).getDouble(200D);
Mekanism.ENERGY_PER_REDSTONE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerRedstone", 10000D).getDouble(10000D);
Mekanism.VOICE_PORT = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoicePort", 36123).getInt();
//If this is less than 1, upgrades make machines worse. If less than 0, I don't even know.
@ -238,7 +239,6 @@ public class CommonProxy
Mekanism.oxidationChamberUsage = Mekanism.configuration.get("usage", "OxidationChamberUsage", 200D).getDouble(200D);
Mekanism.chemicalInfuserUsage = Mekanism.configuration.get("usage", "ChemicalInfuserUsage", 200D).getDouble(200D);
Mekanism.chemicalInjectionChamberUsage = Mekanism.configuration.get("usage", "ChemicalInjectionChamberUsage", 400D).getDouble(400D);
Mekanism.electrolyticSeparatorUsage = Mekanism.configuration.get("usage", "ElectrolyticSeparatorUsage", 50D).getDouble(50D);
Mekanism.precisionSawmillUsage = Mekanism.configuration.get("usage", "PrecisionSawmillUsage", 50D).getDouble(50D);
Mekanism.chemicalDissolutionChamberUsage = Mekanism.configuration.get("usage", "ChemicalDissolutionChamberUsage", 400D).getDouble(400D);
Mekanism.chemicalWasherUsage = Mekanism.configuration.get("usage", "ChemicalWasherUsage", 200D).getDouble(200D);

View file

@ -320,6 +320,7 @@ public class Mekanism
public static double TO_BC;
public static double TO_TE;
public static double TO_UE = .001;
public static double FROM_H2;
public static double FROM_IC2;
public static double FROM_BC;
public static double FROM_TE;
@ -339,7 +340,6 @@ public class Mekanism
public static double oxidationChamberUsage;
public static double chemicalInfuserUsage;
public static double chemicalInjectionChamberUsage;
public static double electrolyticSeparatorUsage;
public static double precisionSawmillUsage;
public static double chemicalDissolutionChamberUsage;
public static double chemicalWasherUsage;

View file

@ -48,6 +48,7 @@ public class PacketConfigSync implements IMekanismPacket
Mekanism.TO_IC2 = dataStream.readDouble();
Mekanism.FROM_BC = dataStream.readDouble();
Mekanism.TO_BC = dataStream.readDouble();
Mekanism.FROM_H2 = dataStream.readDouble();
Mekanism.ENERGY_PER_REDSTONE = dataStream.readDouble();
Mekanism.VOICE_PORT = dataStream.readInt();
Mekanism.maxUpgradeMultiplier = dataStream.readInt();
@ -68,7 +69,6 @@ public class PacketConfigSync implements IMekanismPacket
Mekanism.oxidationChamberUsage = dataStream.readDouble();
Mekanism.chemicalInfuserUsage = dataStream.readDouble();
Mekanism.chemicalInjectionChamberUsage = dataStream.readDouble();
Mekanism.electrolyticSeparatorUsage = dataStream.readDouble();
Mekanism.precisionSawmillUsage = dataStream.readDouble();
Mekanism.chemicalDissolutionChamberUsage = dataStream.readDouble();
Mekanism.chemicalWasherUsage = dataStream.readDouble();
@ -108,6 +108,7 @@ public class PacketConfigSync implements IMekanismPacket
dataStream.writeDouble(Mekanism.TO_IC2);
dataStream.writeDouble(Mekanism.FROM_BC);
dataStream.writeDouble(Mekanism.TO_BC);
dataStream.writeDouble(Mekanism.FROM_H2);
dataStream.writeDouble(Mekanism.ENERGY_PER_REDSTONE);
dataStream.writeInt(Mekanism.VOICE_PORT);
dataStream.writeInt(Mekanism.maxUpgradeMultiplier);
@ -125,7 +126,6 @@ public class PacketConfigSync implements IMekanismPacket
dataStream.writeDouble(Mekanism.oxidationChamberUsage);
dataStream.writeDouble(Mekanism.chemicalInfuserUsage);
dataStream.writeDouble(Mekanism.chemicalInjectionChamberUsage);
dataStream.writeDouble(Mekanism.electrolyticSeparatorUsage);
dataStream.writeDouble(Mekanism.precisionSawmillUsage);
dataStream.writeDouble(Mekanism.chemicalDissolutionChamberUsage);
dataStream.writeDouble(Mekanism.chemicalWasherUsage);

View file

@ -123,7 +123,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
if(canOperate())
{
fillTanks(RecipeHandler.getElectrolyticSeparatorOutput(fluidTank, true));
setEnergy(getEnergy() - Mekanism.electrolyticSeparatorUsage);
setEnergy(getEnergy() - Mekanism.FROM_H2*2);
}
if(leftTank.getGas() != null)
@ -185,7 +185,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
public boolean canOperate()
{
return canFillWithSwap(RecipeHandler.getElectrolyticSeparatorOutput(fluidTank, false)) && getEnergy() >= Mekanism.electrolyticSeparatorUsage;
return canFillWithSwap(RecipeHandler.getElectrolyticSeparatorOutput(fluidTank, false)) && getEnergy() >= Mekanism.FROM_H2*2;
}
public boolean canFillWithSwap(ChemicalPair gases)

View file

@ -44,7 +44,6 @@ public class GeneratorsCommonProxy
MekanismGenerators.advancedSolarGeneration = Mekanism.configuration.get("generation", "AdvancedSolarGeneration", 400D).getDouble(400D);
MekanismGenerators.bioGeneration = Mekanism.configuration.get("generation", "BioGeneration", 250D).getDouble(250D);
MekanismGenerators.heatGeneration = Mekanism.configuration.get("generation", "HeatGeneration", 150D).getDouble(150D);
MekanismGenerators.hydrogenGeneration = Mekanism.configuration.get("generation", "HydrogenGeneration", 400D).getDouble(400D);
MekanismGenerators.solarGeneration = Mekanism.configuration.get("generation", "SolarGeneration", 50D).getDouble(50D);
MekanismGenerators.windGeneration = Mekanism.configuration.get("generation", "WindGeneration", 100D).getDouble(100D);
Mekanism.configuration.save();

View file

@ -62,7 +62,6 @@ public class MekanismGenerators implements IModule
public static double advancedSolarGeneration;
public static double bioGeneration;
public static double heatGeneration;
public static double hydrogenGeneration;
public static double solarGeneration;
public static double windGeneration;
@ -191,7 +190,6 @@ public class MekanismGenerators implements IModule
dataStream.writeDouble(advancedSolarGeneration);
dataStream.writeDouble(bioGeneration);
dataStream.writeDouble(heatGeneration);
dataStream.writeDouble(hydrogenGeneration);
dataStream.writeDouble(solarGeneration);
dataStream.writeDouble(windGeneration);
}
@ -202,7 +200,6 @@ public class MekanismGenerators implements IModule
advancedSolarGeneration = dataStream.readDouble();
bioGeneration = dataStream.readDouble();
heatGeneration = dataStream.readDouble();
hydrogenGeneration = dataStream.readDouble();
solarGeneration = dataStream.readDouble();
windGeneration = dataStream.readDouble();
}

View file

@ -9,6 +9,7 @@ import mekanism.api.gas.GasTransmission;
import mekanism.api.gas.IGasHandler;
import mekanism.api.gas.IGasItem;
import mekanism.api.gas.ITubeConnection;
import mekanism.common.Mekanism;
import mekanism.common.util.ChargeUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.generators.common.MekanismGenerators;
@ -31,7 +32,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
public TileEntityHydrogenGenerator()
{
super("HydrogenGenerator", 40000, MekanismGenerators.hydrogenGeneration*2);
super("HydrogenGenerator", 40000, Mekanism.FROM_H2*4);
inventory = new ItemStack[2];
}
@ -55,7 +56,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
setActive(true);
hydrogenStored-=2;
setEnergy(electricityStored + MekanismGenerators.hydrogenGeneration);
setEnergy(electricityStored + Mekanism.FROM_H2 * 2);
}
else {
setActive(false);