diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-12-01 21:50:23 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-12-01 21:50:23 +0000 |
commit | 6ea3cec7622946ba8190f57d0e64a8addeb89ebd (patch) | |
tree | ca2b15ef49b86fc764081544048dff839ef6ec29 /src/main/java/org/bukkit | |
parent | efed2f00227403e8ace8b55f334b3ef83bc5f6d0 (diff) | |
download | craftbukkit-6ea3cec7622946ba8190f57d0e64a8addeb89ebd.tar craftbukkit-6ea3cec7622946ba8190f57d0e64a8addeb89ebd.tar.gz craftbukkit-6ea3cec7622946ba8190f57d0e64a8addeb89ebd.tar.lz craftbukkit-6ea3cec7622946ba8190f57d0e64a8addeb89ebd.tar.xz craftbukkit-6ea3cec7622946ba8190f57d0e64a8addeb89ebd.zip |
Made world.spawnCreature just delegate to world.spawn. This fixes BUKKIT-57
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index a3b29bf2..0740b302 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -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) { |