diff options
author | Dark Arc <theexcel@rocketmail.com> | 2012-12-06 20:38:23 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-08 02:15:15 -0600 |
commit | 090c1a60bde0fa830d255a138d819a593d79864a (patch) | |
tree | 05e5c13f3bc0a766b9a8e44feaebe06d40483fb2 | |
parent | 9973e7cdec6e8417d99cc75d116b46ce0d6b0c53 (diff) | |
download | craftbukkit-090c1a60bde0fa830d255a138d819a593d79864a.tar craftbukkit-090c1a60bde0fa830d255a138d819a593d79864a.tar.gz craftbukkit-090c1a60bde0fa830d255a138d819a593d79864a.tar.lz craftbukkit-090c1a60bde0fa830d255a138d819a593d79864a.tar.xz craftbukkit-090c1a60bde0fa830d255a138d819a593d79864a.zip |
Correctly shoot arrows with the spawnArrow Method. Fixes BUKKIT-3116
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index f66aa0ed..346b1833 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -304,10 +304,13 @@ public class CraftWorld implements World { } public Arrow spawnArrow(Location loc, Vector velocity, float speed, float spread) { + Validate.notNull(loc, "Can not spawn arrow with a null location"); + Validate.notNull(velocity, "Can not spawn arrow with a null velocity"); + EntityArrow arrow = new EntityArrow(world); - arrow.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), 0, 0); - world.addEntity(arrow); + arrow.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), loc.getPitch(), loc.getYaw()); arrow.shoot(velocity.getX(), velocity.getY(), velocity.getZ(), speed, spread); + world.addEntity(arrow); return (Arrow) arrow.getBukkitEntity(); } |