diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-10-28 02:20:41 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-10-28 02:21:34 -0500 |
commit | d97d193b916ec6c411266357dd4ae9adb2df6234 (patch) | |
tree | a79806032ff57a6ada87fd4795125747495af0b0 | |
parent | 788e9e84cf9fa4209553c382498f5de2ccc17a97 (diff) | |
download | craftbukkit-d97d193b916ec6c411266357dd4ae9adb2df6234.tar craftbukkit-d97d193b916ec6c411266357dd4ae9adb2df6234.tar.gz craftbukkit-d97d193b916ec6c411266357dd4ae9adb2df6234.tar.lz craftbukkit-d97d193b916ec6c411266357dd4ae9adb2df6234.tar.xz craftbukkit-d97d193b916ec6c411266357dd4ae9adb2df6234.zip |
Add new entities to World.spawn method. Fixes BUKKIT-2658
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 46027e84..277c3b3d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -837,6 +837,8 @@ public class CraftWorld implements World { } else if (Fireball.class.isAssignableFrom(clazz)) { if (SmallFireball.class.isAssignableFrom(clazz)) { entity = new EntitySmallFireball(world); + } else if (WitherSkull.class.isAssignableFrom(clazz)) { + entity = new EntityWitherSkull(world); } else { entity = new EntityLargeFireball(world); } @@ -918,16 +920,24 @@ public class CraftWorld implements World { entity = new EntityBlaze(world); } else if (Villager.class.isAssignableFrom(clazz)) { entity = new EntityVillager(world); + } else if (Witch.class.isAssignableFrom(clazz)) { + entity = new EntityWitch(world); + } else if (Wither.class.isAssignableFrom(clazz)) { + entity = new EntityWither(world); } else if (ComplexLivingEntity.class.isAssignableFrom(clazz)) { if (EnderDragon.class.isAssignableFrom(clazz)) { entity = new EntityEnderDragon(world); } + } else if (Ambient.class.isAssignableFrom(clazz)) { + if (Bat.class.isAssignableFrom(clazz)) { + entity = new EntityBat(world); + } } if (entity != null) { entity.setLocation(x, y, z, pitch, yaw); } - } else if (Painting.class.isAssignableFrom(clazz)) { + } else if (Hanging.class.isAssignableFrom(clazz)) { Block block = getBlockAt(location); BlockFace face = BlockFace.SELF; if (block.getRelative(BlockFace.EAST).getTypeId() == 0) { @@ -955,8 +965,14 @@ public class CraftWorld implements World { dir = 3; break; } - entity = new EntityPainting(world, (int) x, (int) y, (int) z, dir); - if (!((EntityPainting) entity).survives()) { + + if (Painting.class.isAssignableFrom(clazz)) { + entity = new EntityPainting(world, (int) x, (int) y, (int) z, dir); + } else if (ItemFrame.class.isAssignableFrom(clazz)) { + entity = new EntityItemFrame(world, (int) x, (int) y, (int) z, dir); + } + + if (entity != null && !((EntityHanging) entity).survives()) { entity = null; } } else if (TNTPrimed.class.isAssignableFrom(clazz)) { |