aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorchochem <40274384+chochem@users.noreply.github.com>2024-01-24 00:04:54 +0000
committerGitHub <noreply@github.com>2024-01-24 00:04:54 +0000
commitb457246f589bf91c60f5dccf86cb272dfecd63f3 (patch)
tree1234fc397d95b87ca2d704c4eaf6f6d39a22ab7c /src/main
parent68b5c6598f9373bf7430733647c198e639e7c94f (diff)
downloadGT5-Unofficial-b457246f589bf91c60f5dccf86cb272dfecd63f3.tar.gz
GT5-Unofficial-b457246f589bf91c60f5dccf86cb272dfecd63f3.tar.bz2
GT5-Unofficial-b457246f589bf91c60f5dccf86cb272dfecd63f3.zip
Fix oc calculator (#2474)
* add new test * voltage difference check iff no amperageOC * fix doubleEnergyHatchOC_Test (passes either way but is coded this way)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gregtech/api/util/GT_OverclockCalculator.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java b/src/main/java/gregtech/api/util/GT_OverclockCalculator.java
index 1b8748237d..e73232096c 100644
--- a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java
+++ b/src/main/java/gregtech/api/util/GT_OverclockCalculator.java
@@ -393,7 +393,7 @@ public class GT_OverclockCalculator {
double machinePowerTier = calculateMachinePowerTier();
overclockCount = calculateAmountOfNeededOverclocks(machinePowerTier, recipePowerTier);
- if (recipeVoltage <= GT_Values.V[0]) {
+ if (!amperageOC) {
overclockCount = Math.min(overclockCount, calculateRecipeToMachineVoltageDifference());
}
if (overclockCount < 0) {
@@ -463,19 +463,19 @@ public class GT_OverclockCalculator {
/**
* Calculates the amount of overclocks needed to reach 1 ticking
- *
+ *
* Here we limit "the tier difference overclock" amount to a number
* of overclocks needed to reach 1 tick duration, for example:
- *
+ *
* recipe initial duration = 250 ticks (12,5 seconds LV(1))
* we have LCR with IV(5) energy hatch, which overclocks at 4/4 rate
- *
+ *
* log_4 (250) ~ 3,98 is the number of overclocks needed to reach 1 tick
- *
+ *
* to calculate log_a(b) we can use the log property:
* log_a(b) = log_c(b) / log_c(a)
* in our case we use natural log base as 'c'
- *
+ *
* as a final step we apply Math.ceil(),
* otherwise for fractional nums like 3,98 we will never reach 1 tick
*/