mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Fixed EntityRegistry.addSpawn adding duplicate spawn entries. Closes #2112
This commit is contained in:
1 parent
0406267d89
commit
b8996b14bc
1 file changed
+4
-1
@@ -234,6 +234,7 @@ public class EntityRegistry
|
||||
{
|
||||
List<SpawnListEntry> spawns = biome.getSpawnableList(typeOfCreature);
|
||||
|
||||
boolean found = false;
|
||||
for (SpawnListEntry entry : spawns)
|
||||
{
|
||||
//Adjusting an existing spawn entry
|
||||
@@ -242,11 +243,13 @@ public class EntityRegistry
|
||||
entry.itemWeight = weightedProb;
|
||||
entry.minGroupCount = min;
|
||||
entry.maxGroupCount = max;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
|
||||
if (!found)
|
||||
spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user