aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Xizhi <60341015+GlodBlock@users.noreply.github.com>2022-06-22 17:03:26 +0800
committerGitHub <noreply@github.com>2022-06-22 11:03:26 +0200
commitaa705de98dfcb52142100098df225d3514985f01 (patch)
tree69ffce916b68d3744ed2d3fccf014d5ee51b4bcd
parentfe0e98b1e835ce3325018ce9ae18eaf6df95da18 (diff)
downloadGT5-Unofficial-aa705de98dfcb52142100098df225d3514985f01.tar.gz
GT5-Unofficial-aa705de98dfcb52142100098df225d3514985f01.tar.bz2
GT5-Unofficial-aa705de98dfcb52142100098df225d3514985f01.zip
fix double consumption from wildcard and oredict (#139)
* fix double consumption from wildcard and oredict sometimes the wildcard item also has oredict, it will cause double consumption * fix Former-commit-id: 36a91e713055060bc5a65b6c5bf07aebcc53898b
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java
index 052c29eff2..2988df6b7f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java
@@ -89,18 +89,6 @@ public class RecipeFinderForParallel {
}
/*OreDict Stuff*/
- for (int tItem : tCompressedItemRecipe.keySet()) {
- ItemStack tRealRecipe = GT_Utility.intToStack(tItem);
- int tTargetAmount = tCompressedItemRecipe.get(tItem);
- for (ItemStack input : aItemStacks) {
- if (GT_OreDictUnificator.isInputStackEqual(input, tRealRecipe)) {
- int d = Math.min(tTargetAmount, input.stackSize);
- tTargetAmount -= d;
- input.stackSize -= d;
- }
- if (tTargetAmount == 0) break;
- }
- }
/*Wildcard Stuff*/
for (int tItem : tCompressedItemRecipe.keySet()) {
if (tItem >> 16 == Short.MAX_VALUE) {
@@ -119,6 +107,22 @@ public class RecipeFinderForParallel {
}
}
}
+ else {
+ ItemStack tRealRecipe = GT_Utility.intToStack(tItem);
+ int tTargetAmount = tCompressedItemRecipe.get(tItem);
+ for (ItemStack input : aItemStacks) {
+ if (GT_OreDictUnificator.isInputStackEqual(input, tRealRecipe)) {
+ int d = Math.min(tTargetAmount, input.stackSize);
+ tTargetAmount -= d;
+ tCompressedItemRecipe.put(tItem, tTargetAmount);
+ input.stackSize -= d;
+ }
+ if (tTargetAmount == 0) {
+ tCompressedItemRecipe.remove(tItem);
+ break;
+ }
+ }
+ }
}
return tCurrentPara;