From a205cbccd0baabe29ee76dad4fb97138367dd425 Mon Sep 17 00:00:00 2001 From: Antifluxfield Date: Tue, 13 Feb 2018 06:11:54 +0800 Subject: [PATCH] Should fix #1389 (#1392) --- .../java/gregtech/api/util/GT_OreDictUnificator.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java index f4977ee1..7b61cd07 100644 --- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java +++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java @@ -138,7 +138,11 @@ public class GT_OreDictUnificator { } public static ItemStack get(boolean aUseBlackList, ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return null; + return get(aUseBlackList, aStack, false); + } + + private static ItemStack get(boolean aUseBlackList, ItemStack aStack, boolean aOnUnificationTableCreation) { + if (GT_Utility.isStackInvalid(aStack)) return null; ItemData tPrefixMaterial = getAssociation(aStack); ItemStack rStack = null; if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() || (aUseBlackList && tPrefixMaterial.mBlackListed)) @@ -149,7 +153,7 @@ public class GT_OreDictUnificator { } if (tPrefixMaterial.mUnificationTarget == null) { tPrefixMaterial.mUnificationTarget = sName2StackMap.get(tPrefixMaterial.toString()); - sUnificationTable.clear(); + if (!aOnUnificationTableCreation) sUnificationTable.clear(); } rStack = tPrefixMaterial.mUnificationTarget; if (GT_Utility.isStackInvalid(rStack)) return GT_Utility.copy(aStack); @@ -163,8 +167,8 @@ public class GT_OreDictUnificator { if (sUnificationTable.isEmpty() && !sItemStack2DataMap.isEmpty()) { for (GT_ItemStack tGTStack0 : sItemStack2DataMap.keySet()) { ItemStack tStack0 = tGTStack0.toStack(); - ItemStack tStack1 = get(false, tStack0); - if (!GT_Utility.areStacksEqual(tStack0, tStack1)) { + ItemStack tStack1 = get(false, tStack0, true); + if (tStack0 != null && tStack1 != null && !GT_Utility.areStacksEqual(tStack0, tStack1)) { GT_ItemStack tGTStack1 = new GT_ItemStack(tStack1); List list = sUnificationTable.get(tGTStack1); if (list == null) sUnificationTable.put(tGTStack1, list = new ArrayList());