Fixed concurent modification exception in the ore registry.

This commit is contained in:
LexManos 2012-06-12 15:32:26 -07:00
parent 76bf4c602b
commit 9bf3436be4

View file

@ -97,15 +97,13 @@ public class OreDictionary
{ {
oreHandlers.add(handler); oreHandlers.add(handler);
Iterator<Map.Entry<String, Integer>> itr = oreIDs.entrySet().iterator(); HashMap<String, Integer> tmp = (HashMap<String, Integer>)oreIDs.clone();
while(itr.hasNext())
{
Map.Entry<String, Integer> entry = itr.next();
Iterator<ItemStack> ores = getOres(entry.getValue()).iterator(); for(Map.Entry<String, Integer> entry : tmp.entrySet())
while (ores.hasNext()) {
for(ItemStack stack : getOres(entry.getValue()))
{ {
handler.registerOre(entry.getKey(), ores.next()); handler.registerOre(entry.getKey(), stack);
} }
} }
} }