From 099baeea145c5e7573315410ffc56e0379f73178 Mon Sep 17 00:00:00 2001 From: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> Date: Thu, 22 Dec 2022 22:37:34 +0200 Subject: 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 --- ...gtechMetaTileEntity_QuantumForceTransformer.java | 21 ++++++++++++++------- 1 file 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; } -- cgit