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() ); } }