From 9bf3436be47032201497aa2d9571a1dc0752fd5c Mon Sep 17 00:00:00 2001 From: LexManos Date: Tue, 12 Jun 2012 15:32:26 -0700 Subject: [PATCH] Fixed concurent modification exception in the ore registry. --- .../minecraft/src/forge/oredict/OreDictionary.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/forge/forge_common/net/minecraft/src/forge/oredict/OreDictionary.java b/forge/forge_common/net/minecraft/src/forge/oredict/OreDictionary.java index 1d63c01a4..3f730f887 100644 --- a/forge/forge_common/net/minecraft/src/forge/oredict/OreDictionary.java +++ b/forge/forge_common/net/minecraft/src/forge/oredict/OreDictionary.java @@ -96,16 +96,14 @@ public class OreDictionary public static void registerOreHandler(IOreHandler handler) { oreHandlers.add(handler); - - Iterator> itr = oreIDs.entrySet().iterator(); - while(itr.hasNext()) + + HashMap tmp = (HashMap)oreIDs.clone(); + + for(Map.Entry entry : tmp.entrySet()) { - Map.Entry entry = itr.next(); - - Iterator ores = getOres(entry.getValue()).iterator(); - while (ores.hasNext()) + for(ItemStack stack : getOres(entry.getValue())) { - handler.registerOre(entry.getKey(), ores.next()); + handler.registerOre(entry.getKey(), stack); } } }