diff options
author | sunkid <sunkid@iminurnetz.com> | 2011-06-20 12:36:46 -0700 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-06-20 16:26:22 -0400 |
commit | 214d412505bfbdb1b85189444082473765dee125 (patch) | |
tree | dd39cff0eb676c4102c40a4ec35597d9e716720c /src/main/java | |
parent | 8df3fe62f45cdc880fd80851ca871633a2031101 (diff) | |
download | craftbukkit-214d412505bfbdb1b85189444082473765dee125.tar craftbukkit-214d412505bfbdb1b85189444082473765dee125.tar.gz craftbukkit-214d412505bfbdb1b85189444082473765dee125.tar.lz craftbukkit-214d412505bfbdb1b85189444082473765dee125.tar.xz craftbukkit-214d412505bfbdb1b85189444082473765dee125.zip |
Added the abitility to spawn fireballs.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 11 |
1 files changed, 8 insertions, 3 deletions
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) { |