summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-02-09 09:14:44 +1100
committermd_5 <git@md-5.net>2017-02-09 09:14:44 +1100
commita552117725a316dbae014fb85e431e5264e631d4 (patch)
treec335d868470e35382b94cb85de837b27c9039376 /src/main
parent3c48711c053bf7c007964f17135c56d6dfe1fda6 (diff)
downloadcraftbukkit-a552117725a316dbae014fb85e431e5264e631d4.tar
craftbukkit-a552117725a316dbae014fb85e431e5264e631d4.tar.gz
craftbukkit-a552117725a316dbae014fb85e431e5264e631d4.tar.lz
craftbukkit-a552117725a316dbae014fb85e431e5264e631d4.tar.xz
craftbukkit-a552117725a316dbae014fb85e431e5264e631d4.zip
SPIGOT-3054: Correct LLamaSpit launching
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index c00260f6..27cd0d43 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -391,9 +391,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
((EntityFireball) launch).projectileSource = this;
launch.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
- } else if (LlamaSpit.class.isAssignableFrom(projectile) && getHandle() instanceof EntityLlama) {
- launch = new EntityLlamaSpit(world, (EntityLlama) getHandle());
- ((EntityProjectile) launch).a(getHandle(), getHandle().pitch, getHandle().yaw, 0.0F, 1.5F, 10.0F); // EntityLlama
+ } else if (LlamaSpit.class.isAssignableFrom(projectile)) {
+ Location location = getEyeLocation();
+ Vector direction = location.getDirection();
+
+ launch = new EntityLlamaSpit(world);
+
+ ((EntityLlamaSpit) launch).shooter = getHandle();
+ ((EntityLlamaSpit) launch).shoot(direction.getX(), direction.getY(), direction.getZ(), 1.5F, 10.0F); // EntityLlama
+ launch.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
}
Validate.notNull(launch, "Projectile not supported");