diff --git a/src/main/java/com/hbm/config/RadiationConfig.java b/src/main/java/com/hbm/config/RadiationConfig.java index 8433143da..446497037 100644 --- a/src/main/java/com/hbm/config/RadiationConfig.java +++ b/src/main/java/com/hbm/config/RadiationConfig.java @@ -12,6 +12,7 @@ public class RadiationConfig { public static float hellRad = 0.1F; public static int worldRad = 10; public static int worldRadThreshold = 20; + public static boolean worldRadEffects = true; public static void loadFromConfig(Configuration config) { @@ -34,6 +35,7 @@ public class RadiationConfig { hellRad = netherRad.getInt() * 0.01F; worldRad = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "6.10_worldRadCount", "How many block operations radiation can perform per tick", 10); worldRadThreshold = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "6.11_worldRadThreshold", "The least amount of RADs required for block modification to happen", 20); + worldRadEffects = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "6.12_worldRadEffects", "Whether high radiation levels should perform changes in the world", true); fogCh = CommonConfig.setDef(fogCh, 20); } diff --git a/src/main/java/com/hbm/handler/RadiationWorldHandler.java b/src/main/java/com/hbm/handler/RadiationWorldHandler.java index 9636a8751..ae7242a2c 100644 --- a/src/main/java/com/hbm/handler/RadiationWorldHandler.java +++ b/src/main/java/com/hbm/handler/RadiationWorldHandler.java @@ -2,6 +2,7 @@ package com.hbm.handler; import java.util.Map.Entry; +import com.hbm.config.RadiationConfig; import com.hbm.saveddata.RadiationSavedData; import net.minecraft.init.Blocks; @@ -17,6 +18,9 @@ public class RadiationWorldHandler { if(!(world instanceof WorldServer)) return; + if(!RadiationConfig.worldRadEffects) + return; + WorldServer serv = (WorldServer)world; RadiationSavedData data = RadiationSavedData.getData(serv); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbine.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbine.java index 78ef133b8..8fe82d151 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbine.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbine.java @@ -235,19 +235,19 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent } else { tanks[1].setTankType((FluidType) outs[0]); - for(int i = 0; i < 1200; i++) { - if(tanks[0].getFill() >= (Integer)outs[2] && tanks[1].getFill() + (Integer)outs[1] <= tanks[1].getMaxFill()) { - tanks[0].setFill(tanks[0].getFill() - (Integer)outs[2]); - tanks[1].setFill(tanks[1].getFill() + (Integer)outs[1]); - - power += (Integer)outs[3]; - - if(power > maxPower) - power = maxPower; - } else { - break; - } - } + int processMax = 1200; //the maximum amount of cycles based on the 1.2k cycle cap (subject to change) + int processSteam = tanks[0].getFill() / (Integer)outs[2]; //the maximum amount of cycles depending on steam + int processWater = (tanks[1].getMaxFill() - tanks[1].getFill()) / (Integer)outs[1]; //the maximum amount of cycles depending on water + + int cycles = Math.min(processMax, Math.min(processSteam, processWater)); + + tanks[0].setFill(tanks[0].getFill() - (Integer)outs[2] * cycles); + tanks[1].setFill(tanks[1].getFill() + (Integer)outs[1] * cycles); + + power += (Integer)outs[3] * cycles; + + if(power > maxPower) + power = maxPower; } tanks[1].unloadTank(5, 6, slots);