Skip to content

Commit

Permalink
add config for salination plant water transformation per update
Browse files Browse the repository at this point in the history
  • Loading branch information
pwestling committed Sep 24, 2014
1 parent 1523b40 commit 986e0ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/main/java/mekanism/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ public void loadConfiguration()
Mekanism.VOICE_PORT = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoicePort", 36123, null, 1, 65535).getInt();
//If this is less than 1, upgrades make machines worse. If less than 0, I don't even know.
Mekanism.maxUpgradeMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpgradeModifier", 10, null, 1, Integer.MAX_VALUE).getInt();

Mekanism.salinationPlantWaterUsage = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SalinationPlantSpeed", 40.0, "Millibuckets of water turned into brine by the plant per tick", 1.0, 9000.0).getDouble();

String s = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyType", "J", null, new String[]{"J", "RF", "MJ", "EU"}).getString();

if(s != null)
Expand Down
1 change: 1 addition & 0 deletions src/main/java/mekanism/common/Mekanism.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ public class Mekanism
public static double seismicVibratorUsage;
public static double pressurizedReactionBaseUsage;
public static double fluidicPlenisherUsage;
public static double salinationPlantWaterUsage;

/**
* Adds all in-game crafting, smelting and machine recipes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class TileEntitySalinationController extends TileEntitySalinationTank
public static final int MAX_BRINE = 10000;
public static final int MAX_SOLARS = 4;
public static final int WARMUP = 10000;
public static final double WATER_USAGE = 40;

public FluidTank waterTank = new FluidTank(0);
public FluidTank brineTank = new FluidTank(MAX_BRINE);
Expand Down Expand Up @@ -93,14 +92,14 @@ public void onUpdate()
int brineNeeded = brineTank.getCapacity()-brineTank.getFluidAmount();
int waterStored = waterTank.getFluidAmount();

partialWater += Math.min(waterTank.getFluidAmount(), getTemperature()*WATER_USAGE);
partialWater += Math.min(waterTank.getFluidAmount(), getTemperature()*Mekanism.salinationPlantWaterUsage);

if(partialWater >= 1)
{
int waterInt = (int)Math.floor(partialWater);
waterTank.drain(waterInt, true);
partialWater %= 1;
partialBrine += ((double)waterInt)/WATER_USAGE;
partialBrine += ((double)waterInt)/Mekanism.salinationPlantWaterUsage;
}

if(partialBrine >= 1)
Expand Down

0 comments on commit 986e0ac

Please sign in to comment.