Made world.spawnCreature just delegate to world.spawn. This fixes BUKKIT-57

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot 2011-12-01 21:50:23 +00:00
parent b327d49e49
commit 0945d42bf0

View File

@ -320,17 +320,13 @@ public class CraftWorld implements World {
}
public LivingEntity spawnCreature(Location loc, CreatureType creatureType) {
LivingEntity creature;
try {
EntityLiving entityCreature = (EntityLiving) EntityTypes.a(creatureType.getName(), world);
entityCreature.setPosition(loc.getX(), loc.getY(), loc.getZ());
creature = (LivingEntity) CraftEntity.getEntity(server, entityCreature);
world.addEntity(entityCreature, SpawnReason.CUSTOM);
} catch (Exception e) {
// if we fail, for any reason, return null.
creature = null;
Entity result = spawn(loc, creatureType.getEntityClass());
if (result == null) {
return null;
}
return creature;
return (LivingEntity)result;
}
public LightningStrike strikeLightning(Location loc) {