From b5dc294d32b43514929d35e86e4a45b807d543ca Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 3 Aug 2017 08:23:27 +1000 Subject: [PATCH] SPIGOT-3485: Launch shulker bullets as projectiles --- .../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index ede2e9324a..922a0f0e35 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -24,6 +24,7 @@ import net.minecraft.server.EntityLlamaSpit; import net.minecraft.server.EntityPlayer; import net.minecraft.server.EntityPotion; import net.minecraft.server.EntityProjectile; +import net.minecraft.server.EntityShulkerBullet; import net.minecraft.server.EntitySmallFireball; import net.minecraft.server.EntitySnowball; import net.minecraft.server.EntityThrownExpBottle; @@ -60,6 +61,7 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LlamaSpit; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; +import org.bukkit.entity.ShulkerBullet; import org.bukkit.entity.SmallFireball; import org.bukkit.entity.Snowball; import org.bukkit.entity.SpectralArrow; @@ -400,6 +402,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { ((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()); + } else if (ShulkerBullet.class.isAssignableFrom(projectile)) { + Location location = getEyeLocation(); + + launch = new EntityShulkerBullet(world, getHandle(), null, null); + launch.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); } Validate.notNull(launch, "Projectile not supported");