aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/ggfab/util
diff options
context:
space:
mode:
authorHoleFish <48403212+HoleFish@users.noreply.github.com>2024-09-06 04:22:57 +0800
committerGitHub <noreply@github.com>2024-09-05 20:22:57 +0000
commitfb8401a6c1f5e83817fe6fed332f6d652e1a2a07 (patch)
tree877c7cc2e4dcc6b45c2637339ea2a7f913d00714 /src/main/java/ggfab/util
parente9aee5637c9d77ecc21cf95d90292ccf7a654764 (diff)
downloadGT5-Unofficial-fb8401a6c1f5e83817fe6fed332f6d652e1a2a07.tar.gz
GT5-Unofficial-fb8401a6c1f5e83817fe6fed332f6d652e1a2a07.tar.bz2
GT5-Unofficial-fb8401a6c1f5e83817fe6fed332f6d652e1a2a07.zip
Enhance GPL for several multis (#3071)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/ggfab/util')
-rw-r--r--src/main/java/ggfab/util/OverclockHelper.java75
1 files changed, 0 insertions, 75 deletions
diff --git a/src/main/java/ggfab/util/OverclockHelper.java b/src/main/java/ggfab/util/OverclockHelper.java
deleted file mode 100644
index b0e42930e8..0000000000
--- a/src/main/java/ggfab/util/OverclockHelper.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package ggfab.util;
-
-import gregtech.api.util.GTUtility;
-
-public class OverclockHelper {
-
- public static OverclockOutput normalOverclock(long recipeEUt, int duration, long inputVoltage, boolean perfectOC) {
- if (recipeEUt > inputVoltage) return null;
- int recipeTier = Math.max(1, GTUtility.getTier(recipeEUt)); // ULV no overclock
- int machineTier = GTUtility.getTier(inputVoltage);
- int shift = perfectOC ? 2 : 1;
- while (recipeTier < machineTier && duration > 1) {
- duration >>= shift;
- recipeEUt <<= 2;
- recipeTier++;
- }
- return new OverclockOutput(recipeEUt, duration);
- }
-
- public static OverclockOutput laserOverclock(long recipeEUt, int duration, long inputEUt,
- float penaltyIncreaseFactor) {
- if (recipeEUt > inputEUt) return null;
- float currentPenalty = 4 + penaltyIncreaseFactor;
- // 2/(n+k) overclock until energy hatch is crying
- // must ensure it doesn't go to negative after overclock
- while (recipeEUt * currentPenalty > 0 && recipeEUt * currentPenalty < inputEUt && duration > 1) {
- duration >>= 1;
- recipeEUt *= currentPenalty;
- currentPenalty += penaltyIncreaseFactor;
- }
- return new OverclockOutput(recipeEUt, duration);
- }
-
- public static final class OverclockOutput {
-
- private final long mEUt;
- private final int mDuration;
-
- public OverclockOutput(long aEUt, int aDuration) {
- this.mEUt = aEUt;
- this.mDuration = aDuration;
- }
-
- public long getEUt() {
- return mEUt;
- }
-
- public int getDuration() {
- return mDuration;
- }
-
- @Override
- public String toString() {
- return mEUt + "@" + mDuration + "ticks";
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof OverclockOutput)) return false;
-
- OverclockOutput that = (OverclockOutput) o;
-
- if (mEUt != that.mEUt) return false;
- return mDuration == that.mDuration;
- }
-
- @Override
- public int hashCode() {
- int result = (int) (mEUt ^ (mEUt >>> 32));
- result = 31 * result + mDuration;
- return result;
- }
- }
-}