diff options
author | BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> | 2022-12-22 22:37:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-22 21:37:34 +0100 |
commit | 099baeea145c5e7573315410ffc56e0379f73178 (patch) | |
tree | 846fd766e37d5508e7ed48bfcf28262ca8dc2113 /src/main | |
parent | e6918baa806507d236a00d6ab3fe0067bd6acda9 (diff) | |
download | GT5-Unofficial-099baeea145c5e7573315410ffc56e0379f73178.tar.gz GT5-Unofficial-099baeea145c5e7573315410ffc56e0379f73178.tar.bz2 GT5-Unofficial-099baeea145c5e7573315410ffc56e0379f73178.zip |
Fix QFT Parallel not calculated correctly (#461)
* fixQFTParallel
* apparently its only fluids, fix wrong OC calculation
* no need for dividing then
* OC fix
* oops on the return
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java index b5fc3b6ebb..392b52942d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java @@ -712,9 +712,10 @@ public class GregtechMetaTileEntity_QuantumForceTransformer private boolean processRecipe( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, GT_Recipe.GT_Recipe_Map aRecipeMap, ItemStack aStack) { - long tVoltage = - getMaxInputVoltage() / getExoticAndNormalEnergyHatchList().size(); - long tAmps = (long) Math.floor(getMaxInputAmps() * 0.80); + int hatches = getExoticAndNormalEnergyHatchList().size(); + long tVoltage = getMaxInputVoltage() / hatches; + // Need to check weather the hatches used are TT ones or not as TT hatches can request 20% more amps + long tAmps = (long) Math.floor(mExoticEnergyHatches.isEmpty() ? getMaxInputAmps() : getMaxInputAmps() * 0.80); long tTotalEUt = tVoltage * tAmps; byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = aRecipeMap @@ -821,10 +822,8 @@ public class GregtechMetaTileEntity_QuantumForceTransformer GT_Utility.copyAmountUnsafe(aItem.stackSize * mCurrentParallel, aItem)); } } else { - FluidStack aFluid = tRecipe.getFluidOutput(i - tRecipe.mOutputs.length) - .copy(); - aFluid.amount *= mCurrentParallel; - tFluidOutputs.add(aFluid); + FluidStack aFluid = tRecipe.getFluidOutput(i - tRecipe.mOutputs.length); + tFluidOutputs.add(new FluidStack(aFluid, aFluid.amount * mCurrentParallel)); } } } @@ -1090,6 +1089,10 @@ public class GregtechMetaTileEntity_QuantumForceTransformer long zMaxInputVoltage = maxInputVoltage / 100L * 95L; long zTime = aDuration; long zEUt = aEUt; + if (zEUt > zMaxInputVoltage) { + zTime = Integer.MAX_VALUE - 1; + zEUt = Long.MAX_VALUE - 1; + } while (zEUt << 2 < zMaxInputVoltage) { zEUt = zEUt << 2; zTime = zTime >> (perfectOC ? 2 : 1); @@ -1097,6 +1100,10 @@ public class GregtechMetaTileEntity_QuantumForceTransformer break; } } + if (zEUt > zMaxInputVoltage) { + zEUt = zEUt >> 2; + zTime = zTime << (perfectOC ? 2 : 1); + } if (zTime <= 0) { zTime = 1; } |