diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index e5130bf609..cac3427001 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1493,6 +1493,8 @@ public class CraftWorld implements World { } else if (LlamaSpit.class.isAssignableFrom(clazz)) { entity = EntityTypes.LLAMA_SPIT.a(world); entity.setPositionRotation(x, y, z, yaw, pitch); + } else if (Firework.class.isAssignableFrom(clazz)) { + entity = new EntityFireworks(world, x, y, z, net.minecraft.server.ItemStack.b); } } else if (Minecart.class.isAssignableFrom(clazz)) { if (PoweredMinecart.class.isAssignableFrom(clazz)) { @@ -1760,8 +1762,6 @@ public class CraftWorld implements World { entity = new EntityExperienceOrb(world, x, y, z, 0); } else if (LightningStrike.class.isAssignableFrom(clazz)) { entity = EntityTypes.LIGHTNING_BOLT.a(world); - } else if (Firework.class.isAssignableFrom(clazz)) { - entity = new EntityFireworks(world, x, y, z, net.minecraft.server.ItemStack.b); } else if (AreaEffectCloud.class.isAssignableFrom(clazz)) { entity = new EntityAreaEffectCloud(world, x, y, z); } else if (EvokerFangs.class.isAssignableFrom(clazz)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 28151d1537..8f16b27123 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -15,6 +15,7 @@ import net.minecraft.server.EntityDragonFireball; import net.minecraft.server.EntityEgg; import net.minecraft.server.EntityEnderPearl; import net.minecraft.server.EntityFireball; +import net.minecraft.server.EntityFireworks; import net.minecraft.server.EntityFishingHook; import net.minecraft.server.EntityHuman; import net.minecraft.server.EntityInsentient; @@ -58,6 +59,7 @@ import org.bukkit.entity.EnderPearl; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Fireball; +import org.bukkit.entity.Firework; import org.bukkit.entity.FishHook; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.LingeringPotion; @@ -437,6 +439,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { launch = new EntityShulkerBullet(world, getHandle(), null, null); launch.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + } else if (Firework.class.isAssignableFrom(projectile)) { + Location location = getEyeLocation(); + + launch = new EntityFireworks(world, net.minecraft.server.ItemStack.b, getHandle()); + launch.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); } Validate.notNull(launch, "Projectile not supported");