diff options
Diffstat (limited to 'src/main/java/gregtech/common/power')
-rw-r--r-- | src/main/java/gregtech/common/power/BasicMachineEUPower.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/gregtech/common/power/BasicMachineEUPower.java b/src/main/java/gregtech/common/power/BasicMachineEUPower.java index aad3a72718..9a858838a9 100644 --- a/src/main/java/gregtech/common/power/BasicMachineEUPower.java +++ b/src/main/java/gregtech/common/power/BasicMachineEUPower.java @@ -14,10 +14,10 @@ public class BasicMachineEUPower extends EUPower { public void computePowerUsageAndDuration(int euPerTick, int duration) { super.computePowerUsageAndDuration(euPerTick, duration); if (tier == 0) { - //Long time calculation + // Long time calculation long xMaxProgresstime = ((long) duration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long + // make impossible if too long recipeEuPerTick = Integer.MAX_VALUE - 1; recipeDuration = Integer.MAX_VALUE - 1; } else { @@ -25,28 +25,28 @@ public class BasicMachineEUPower extends EUPower { recipeDuration = (int) xMaxProgresstime; } } else { - //Long EUt calculation + // Long EUt calculation long xEUt = euPerTick; - //Isnt too low EUt check? + // Isnt too low EUt check? long tempEUt = Math.max(xEUt, V[1]); recipeDuration = duration; while (tempEUt <= V[tier - 1] * (long) amperage) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - recipeDuration >>= 1;//this is effect of overclocking - xEUt = recipeDuration == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use 2x less power + tempEUt <<= 2; // this actually controls overclocking + // xEUt *= 4;//this is effect of everclocking + recipeDuration >>= 1; // this is effect of overclocking + xEUt = recipeDuration == 0 + ? xEUt >> 1 + : xEUt << 2; // U know, if the time is less than 1 tick make the machine use 2x less power } if (xEUt > Integer.MAX_VALUE - 1) { recipeEuPerTick = Integer.MAX_VALUE - 1; recipeDuration = Integer.MAX_VALUE - 1; } else { recipeEuPerTick = (int) xEUt; - if (recipeEuPerTick == 0) - recipeEuPerTick = 1; - if (recipeDuration == 0) - recipeDuration = 1;//set time to 1 tick + if (recipeEuPerTick == 0) recipeEuPerTick = 1; + if (recipeDuration == 0) recipeDuration = 1; // set time to 1 tick } } wasOverclocked = checkIfOverclocked(); |