From dfe4ed1c3ecce1b33e64de474f05b268a078e85a Mon Sep 17 00:00:00 2001 From: Parker Hawke Date: Tue, 31 Jan 2017 21:12:17 -0500 Subject: [PATCH] Add implementation for LlamaSpit in ProjectileSource#launchProjectile --- .../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 58fbed1d30..c00260f679 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -19,6 +19,8 @@ import net.minecraft.server.EntityFireball; import net.minecraft.server.EntityInsentient; import net.minecraft.server.EntityLargeFireball; import net.minecraft.server.EntityLiving; +import net.minecraft.server.EntityLlama; +import net.minecraft.server.EntityLlamaSpit; import net.minecraft.server.EntityPlayer; import net.minecraft.server.EntityPotion; import net.minecraft.server.EntityProjectile; @@ -55,6 +57,7 @@ import org.bukkit.entity.Fish; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.LingeringPotion; import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.LlamaSpit; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.entity.SmallFireball; @@ -388,6 +391,9 @@ 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 } Validate.notNull(launch, "Projectile not supported");