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

This commit is contained in:
Nathan Adams 2011-12-01 21:50:23 +00:00
parent efed2f0022
commit 6ea3cec762

View File

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