From 214d412505bfbdb1b85189444082473765dee125 Mon Sep 17 00:00:00 2001 From: sunkid Date: Mon, 20 Jun 2011 12:36:46 -0700 Subject: Added the abitility to spawn fireballs. --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index ba3dd2e2..4f08d394 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -689,7 +689,10 @@ public class CraftWorld implements World { } else if (FallingSand.class.isAssignableFrom(clazz)) { entity = new EntityFallingSand(world, x, y, z, 0); } else if (Fireball.class.isAssignableFrom(clazz)) { - // need a shooter + entity = new EntityFireball(world); + ((EntityFireball) entity).setPositionRotation(x, y, z, yaw, pitch); + Vector direction = location.getDirection().multiply(10); + ((EntityFireball) entity).setDirection(direction.getX(), direction.getY(), direction.getZ()); } else if (Snowball.class.isAssignableFrom(clazz)) { entity = new EntitySnowball(world, x, y, z); } else if (Minecart.class.isAssignableFrom(clazz)) { @@ -713,8 +716,6 @@ public class CraftWorld implements World { entity = new EntityCow(world); } else if (Creeper.class.isAssignableFrom(clazz)) { entity = new EntityCreeper(world); - } else if (Fish.class.isAssignableFrom(clazz)) { - entity = new EntityFish(world); } else if (Ghast.class.isAssignableFrom(clazz)) { entity = new EntityGhast(world); } else if (Pig.class.isAssignableFrom(clazz)) { @@ -752,6 +753,10 @@ public class CraftWorld implements World { entity = new EntityWeatherStorm(world, x, y, z); } else if (LightningStrike.class.isAssignableFrom(clazz)) { // what is this, I don't even + } else if (Fish.class.isAssignableFrom(clazz)) { + // this is not a fish, it's a bobber, and it's probably useless + entity = new EntityFish(world); + entity.setLocation(x, y, z, pitch, yaw); } if (entity != null) { -- cgit v1.2.3