Fixed EntityRegistry.addSpawn adding duplicate spawn entries. Closes #2112
This commit is contained in:
parent
0406267d89
commit
b8996b14bc
1 changed files with 4 additions and 1 deletions
|
@ -234,6 +234,7 @@ public class EntityRegistry
|
||||||
{
|
{
|
||||||
List<SpawnListEntry> spawns = biome.getSpawnableList(typeOfCreature);
|
List<SpawnListEntry> spawns = biome.getSpawnableList(typeOfCreature);
|
||||||
|
|
||||||
|
boolean found = false;
|
||||||
for (SpawnListEntry entry : spawns)
|
for (SpawnListEntry entry : spawns)
|
||||||
{
|
{
|
||||||
//Adjusting an existing spawn entry
|
//Adjusting an existing spawn entry
|
||||||
|
@ -242,10 +243,12 @@ public class EntityRegistry
|
||||||
entry.itemWeight = weightedProb;
|
entry.itemWeight = weightedProb;
|
||||||
entry.minGroupCount = min;
|
entry.minGroupCount = min;
|
||||||
entry.maxGroupCount = max;
|
entry.maxGroupCount = max;
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!found)
|
||||||
spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
|
spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue