diff options
author | Raven Szewczyk <git@eigenraven.me> | 2022-08-27 10:19:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-27 11:19:57 +0200 |
commit | 6f31720697bcc351421a4d86ba3bf749375dd12c (patch) | |
tree | 3adf8f318f22c892d74cd7c9d30b6dd3f11f11bd /src/main/java/gregtech/common/power | |
parent | c3eac50decd33ee2be8703dfb2ecf9cdc31c2b67 (diff) | |
download | GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.gz GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.bz2 GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.zip |
Update buildscript & apply spotless (#1306)
* Update dependencies
* Update buildscript, apply spotless
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(); |