Should fix concurent modification exceptions when using removeSpawns
This commit is contained in:
parent
5ee3a057a2
commit
07bebf187c
|
@ -1,6 +1,7 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
@ -131,13 +132,14 @@ public class ClientRegistry implements IMinecraftRegistry
|
||||||
for (BiomeGenBase biome : biomes)
|
for (BiomeGenBase biome : biomes)
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<SpawnListEntry> spawns = biome.func_25063_a(typeOfCreature);
|
Iterator<SpawnListEntry> spawns = biome.func_25063_a(typeOfCreature).iterator();
|
||||||
|
|
||||||
for (SpawnListEntry entry : Collections.unmodifiableList(spawns))
|
while (spawns.hasNext())
|
||||||
{
|
{
|
||||||
|
SpawnListEntry entry = spawns.next();
|
||||||
if (entry.field_25212_a == entityClass)
|
if (entry.field_25212_a == entityClass)
|
||||||
{
|
{
|
||||||
spawns.remove(entry);
|
spawns.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.IMinecraftRegistry;
|
import cpw.mods.fml.common.registry.IMinecraftRegistry;
|
||||||
|
@ -121,13 +122,14 @@ public class ServerRegistry implements IMinecraftRegistry
|
||||||
for (BiomeGenBase biome : biomes)
|
for (BiomeGenBase biome : biomes)
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<SpawnListEntry> spawns = biome.func_25055_a(typeOfCreature);
|
Iterator<SpawnListEntry> spawns = biome.func_25055_a(typeOfCreature).iterator();
|
||||||
|
|
||||||
for (SpawnListEntry entry : Collections.unmodifiableList(spawns))
|
while (spawns.hasNext())
|
||||||
{
|
{
|
||||||
|
SpawnListEntry entry = spawns.next();
|
||||||
if (entry.field_25145_a == entityClass)
|
if (entry.field_25145_a == entityClass)
|
||||||
{
|
{
|
||||||
spawns.remove(entry);
|
spawns.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue