Skip to content

Commit

Permalink
Fix #1125 (#1151)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmhmm8 authored and screret committed May 3, 2024
1 parent 691770b commit 213cf58
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public static Tuple<GTRecipe, Integer> accurateParallel(MetaMachine machine, @No
if (maxParallel == 1) {
return new Tuple<>(recipe, 1);
}
// if(!(machine instanceof ITieredMachine))return new Tuple<>(recipe, 1);
if (machine instanceof IRecipeCapabilityHolder holder) {
var parallel = tryParallel(holder, recipe, 1, maxParallel, modifyDuration);
return parallel == null ? new Tuple<>(recipe, 1) : parallel;
Expand All @@ -106,9 +107,9 @@ private static Tuple<GTRecipe, Integer> tryParallel(IRecipeCapabilityHolder hold
if (min > max) return null;

int mid = (min + max) / 2;

GTRecipe copied = original.copy(ContentModifier.multiplier(mid), modifyDuration);
if (!copied.matchRecipe(holder).isSuccess() || !copied.matchTickRecipe(holder).isSuccess()) {
if (!copied.matchRecipe(holder).isSuccess() || !copied.matchTickRecipe(holder).isSuccess() ||
!(holder instanceof ITieredMachine && RecipeHelper.getRecipeEUtTier(copied) <= ((ITieredMachine)holder).getTier())) {
// tried too many
return tryParallel(holder, original, min, mid - 1, modifyDuration);
} else {
Expand Down

0 comments on commit 213cf58

Please sign in to comment.