From c9633115ac7a2deb5a2559b2738c3f340104a961 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Sat, 17 Sep 2022 01:27:53 +0800 Subject: [PATCH] fix overflow cal when max input voltage over max (#80) * fix overflow cal when max input voltage over max * int - 1 --- .../goodgenerator/blocks/tileEntity/PreciseAssembler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java b/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java index 5017a143..6af5ee91 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java @@ -194,7 +194,7 @@ public boolean checkRecipe_EM(ItemStack itemStack) { this.mEfficiencyIncrease = 10000; tRecipe.isRecipeInputEqual(true, inputFluids, getStoredItemFromHatch(bus)); mOutputItems = tRecipe.mOutputs; - calculateOverclockedNessMulti( + calculateOverclockedNessMultiPara( tRecipe.mEUt, tRecipe.mDuration, 1, @@ -234,7 +234,7 @@ public boolean checkRecipe_EM(ItemStack itemStack) { } mOutputItems = Outputs.getValue().toArray(new ItemStack[0]); calculateOverclockedNessMultiPara( - (int) lEUt, time, 1, Math.min(Integer.MAX_VALUE, getMaxInputEnergy_EM())); + (int) lEUt, time, 1, Math.min(Integer.MAX_VALUE - 1, getMaxInputEnergy_EM())); this.updateSlots(); if (this.mEUt > 0) { this.mEUt = (-this.mEUt);