From 4338caa78228dedb8e472eff309ad614fe33d966 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 17 Aug 2014 03:58:42 -0500 Subject: [PATCH] Non-Configured Level Emitters no longer prevent crafting recipes from registering. --- me/cache/CraftingGridCache.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/me/cache/CraftingGridCache.java b/me/cache/CraftingGridCache.java index 7ef8ba895..a6459cb57 100644 --- a/me/cache/CraftingGridCache.java +++ b/me/cache/CraftingGridCache.java @@ -287,18 +287,17 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper private void updatePatterns() { - // update the stuff that was in the list... - for (IAEItemStack out : craftableItems.keySet()) - { - out.reset(); - sg.postAlterationOfStoredItems( StorageChannel.ITEMS, out, new BaseActionSource() ); - } + HashMap> oldItems = craftableItems; // erase list. craftingMethods.clear(); - craftableItems.clear(); + craftableItems = new HashMap(); emitableItems.clear(); + // update the stuff that was in the list... + for (IAEItemStack out : oldItems.keySet()) + sg.postAlterationOfStoredItems( StorageChannel.ITEMS, out, new BaseActionSource() ); + // re-create list.. for (ICraftingProvider cp : providers) cp.provideCrafting( this ); @@ -320,7 +319,6 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper tmpCraft.put( out, methods = new HashSet() ); methods.add( details ); - sg.postAlterationOfStoredItems( StorageChannel.ITEMS, out, new BaseActionSource() ); } } @@ -328,6 +326,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper for (Entry> e : tmpCraft.entrySet()) { craftableItems.put( e.getKey(), ImmutableSortedSet.copyOf( e.getValue() ) ); + sg.postAlterationOfStoredItems( StorageChannel.ITEMS, e.getKey(), new BaseActionSource() ); } }