aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2021-12-12 23:28:21 +0800
committerGitHub <noreply@github.com>2021-12-12 16:28:21 +0100
commitce50964f714e363c4ea72bfd2899fafbc363c12b (patch)
treec460480b860f4cf0c1295d17df5c5ceaf6672ec6 /src
parentb167f9ee9860a0123068e962d01939315a918d88 (diff)
downloadGT5-Unofficial-ce50964f714e363c4ea72bfd2899fafbc363c12b.tar.gz
GT5-Unofficial-ce50964f714e363c4ea72bfd2899fafbc363c12b.tar.bz2
GT5-Unofficial-ce50964f714e363c4ea72bfd2899fafbc363c12b.zip
Fix unification caching ItemStack where it should not (#69)
Former-commit-id: 7ad3064608f2f56f3d842d97a9bc5df9309ad4c4
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
index e843107ab8..94bfb4c584 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
@@ -156,10 +156,7 @@ public class StaticRecipeChangeLoaders {
iterator.remove();
continue nextRecipe;
}
- else {
- int amount = recipe.mInputs[i].stackSize;
- recipe.mInputs[i] = BW_Util.setStackSize(replacement, amount);
- }
+ recipe.mInputs[i] = GT_Utility.copyAmount(recipe.mInputs[i].stackSize, replacement);
}
for (int i = 0; i < recipe.mOutputs.length; i++) {
if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace))
@@ -168,22 +165,17 @@ public class StaticRecipeChangeLoaders {
iterator.remove();
continue nextRecipe;
}
- else {
- int amount = recipe.mOutputs[i].stackSize;
- recipe.mOutputs[i] = BW_Util.setStackSize(replacement, amount);
- }
+ recipe.mOutputs[i] = GT_Utility.copyAmount(recipe.mOutputs[i].stackSize, replacement);
}
if (recipe.mSpecialItems instanceof ItemStack) {
- if (!GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace))
+ ItemStack specialItemStack = (ItemStack) recipe.mSpecialItems;
+ if (!GT_Utility.areStacksEqual(specialItemStack, toReplace))
continue;
if (removal) {
iterator.remove();
continue nextRecipe;
}
- else {
- int amount = ((ItemStack) recipe.mSpecialItems).stackSize;
- recipe.mSpecialItems = BW_Util.setStackSize(replacement, amount);
- }
+ recipe.mSpecialItems = GT_Utility.copyAmount((specialItemStack).stackSize, replacement);
}
}
}