summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParker Hawke <hawkeboyz2@hotmail.com>2017-01-31 21:12:17 -0500
committermd_5 <git@md-5.net>2017-02-01 13:14:41 +1100
commitdfe4ed1c3ecce1b33e64de474f05b268a078e85a (patch)
treedbc6c7969887c4fe9996c0ddf0e13a7379f5cfe0
parent5ae629285eafa5c27b23aef5b728345680471a10 (diff)
downloadcraftbukkit-dfe4ed1c3ecce1b33e64de474f05b268a078e85a.tar
craftbukkit-dfe4ed1c3ecce1b33e64de474f05b268a078e85a.tar.gz
craftbukkit-dfe4ed1c3ecce1b33e64de474f05b268a078e85a.tar.lz
craftbukkit-dfe4ed1c3ecce1b33e64de474f05b268a078e85a.tar.xz
craftbukkit-dfe4ed1c3ecce1b33e64de474f05b268a078e85a.zip
Add implementation for LlamaSpit in ProjectileSource#launchProjectile
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 58fbed1d..c00260f6 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");