From b8996b14bcdf4de87a4b9bf8989e9b13f85a1823 Mon Sep 17 00:00:00 2001 From: LexManos Date: Sat, 28 May 2016 20:53:19 -0700 Subject: [PATCH] Fixed EntityRegistry.addSpawn adding duplicate spawn entries. Closes #2112 --- .../minecraftforge/fml/common/registry/EntityRegistry.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/fml/common/registry/EntityRegistry.java b/src/main/java/net/minecraftforge/fml/common/registry/EntityRegistry.java index 9a68d4c1f..7cb57061c 100644 --- a/src/main/java/net/minecraftforge/fml/common/registry/EntityRegistry.java +++ b/src/main/java/net/minecraftforge/fml/common/registry/EntityRegistry.java @@ -234,6 +234,7 @@ public class EntityRegistry { List 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)); } }