Added a null check for config file entity spawns

This commit is contained in:
Adubbz 2015-03-11 06:14:14 +11:00
parent a49339667f
commit b3eaca7d51
1 changed files with 13 additions and 10 deletions

View File

@ -57,17 +57,20 @@ public class JsonEntitySpawn
for (JsonEntitySpawn entitySpawn : jsonBiome.entities)
{
try
{
EnumCreatureType creatureType = EnumCreatureType.valueOf(entitySpawn.entityType.toUpperCase());
Class entityClass = Class.forName(entitySpawn.entityClass);
if (entitySpawn != null)
{
try
{
EnumCreatureType creatureType = EnumCreatureType.valueOf(entitySpawn.entityType.toUpperCase());
Class entityClass = Class.forName(entitySpawn.entityClass);
biome.getSpawnableList(creatureType).add(new BiomeGenBase.SpawnListEntry(entityClass, entitySpawn.weight, entitySpawn.minGroupCount, entitySpawn.maxGroupCount));
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
biome.getSpawnableList(creatureType).add(new BiomeGenBase.SpawnListEntry(entityClass, entitySpawn.weight, entitySpawn.minGroupCount, entitySpawn.maxGroupCount));
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
}
}