summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2011-12-01 21:50:23 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2011-12-01 21:50:23 +0000
commit6ea3cec7622946ba8190f57d0e64a8addeb89ebd (patch)
treeca2b15ef49b86fc764081544048dff839ef6ec29 /src/main/java/org/bukkit
parentefed2f00227403e8ace8b55f334b3ef83bc5f6d0 (diff)
downloadcraftbukkit-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.java16
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) {