aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2023-03-25 22:11:37 +0800
committerGitHub <noreply@github.com>2023-03-25 22:11:37 +0800
commitd88c6190b00f5d3ae6d6ce9bb127ee9bf641658d (patch)
tree61c66f5d90f469a2c358ae9ac52fb06f85eddc42 /src
parente442c654ef26fcd04656d6c4b24857b7d545fb7b (diff)
downloadGT5-Unofficial-d88c6190b00f5d3ae6d6ce9bb127ee9bf641658d.tar.gz
GT5-Unofficial-d88c6190b00f5d3ae6d6ce9bb127ee9bf641658d.tar.bz2
GT5-Unofficial-d88c6190b00f5d3ae6d6ce9bb127ee9bf641658d.zip
fix rare underclock with adv assline (#7)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java b/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java
index 8f31dfc0a6..fcaa37256a 100644
--- a/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java
+++ b/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java
@@ -497,7 +497,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas
// overflow again :(
lEUt = Long.MIN_VALUE;
for (int i = 0; i < working; i++) {
- if (!drainEnergyInput(-baseEUt)){
+ if (!drainEnergyInput(-baseEUt)) {
criticalStopMachine();
return false;
}
@@ -638,7 +638,16 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas
if (recipe != null && recipe.mEUt <= inputVoltage) {
setCurrentRecipe(stack, recipe);
// first overclock normally
- calculateOverclockedNessMulti((long) currentRecipe.mEUt, Math.max(recipe.mDuration / recipe.mInputs.length, 1), 1, inputVoltage);
+ // we use the new oc calculator instead
+ // calculateOverclockedNessMulti from super class has a mysterious 5% cable loss thing at the moment
+ // of writing
+ GT_OverclockCalculator ocCalc = new GT_OverclockCalculator()
+ .setRecipeEUt(currentRecipe.mEUt)
+ .setDuration(Math.max(recipe.mDuration / recipe.mInputs.length, 1))
+ .setEUt(inputVoltage);
+ // since we already checked mEUt <= inputVoltage, no need to check if recipe is too OP
+ lEUt = ocCalc.getConsumption();
+ mMaxProgresstime = ocCalc.getDuration();
// then laser overclock if needed
if (!mExoticEnergyHatches.isEmpty()) {
OverclockHelper.OverclockOutput laserOverclock = OverclockHelper.laserOverclock(lEUt, mMaxProgresstime, inputEUt / recipe.mInputs.length, ConfigurationHandler.INSTANCE.getLaserOCPenaltyFactor());
@@ -647,14 +656,6 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas
mMaxProgresstime = laserOverclock.getDuration();
}
}
- // In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && lEUt == Integer.MAX_VALUE - 1) {
- if (GT_Values.D1) {
- GT_FML_LOGGER.info("Recipe too OP");
- }
- mMaxProgresstime = 0;
- continue;
- }
// correct the recipe duration
mMaxProgresstime *= recipe.mInputs.length;
break;