From a3916fd4dae48314005ab0bf8cba929cf08f30f9 Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Sat, 21 Sep 2024 20:08:31 +0200 Subject: [PATCH] Correctly launch WindCharges (#11418) The launch API on LivingEntity only respected the WindCharge type, not its near-clone BreezeWindCharge. This commit correctly accounts for BreezeWindCharge in CraftLivingEntity. --- patches/server/More-Projectile-API.patch | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/patches/server/More-Projectile-API.patch b/patches/server/More-Projectile-API.patch index 71c17f03c7..34eee0a11b 100644 --- a/patches/server/More-Projectile-API.patch +++ b/patches/server/More-Projectile-API.patch @@ -527,6 +527,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else if (ThrownPotion.class.isAssignableFrom(projectile)) { if (LingeringPotion.class.isAssignableFrom(projectile)) { launch = new net.minecraft.world.entity.projectile.ThrownPotion(world, this.getHandle()); +@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + launch = new net.minecraft.world.entity.projectile.WitherSkull(world, this.getHandle(), vec); + } else if (DragonFireball.class.isAssignableFrom(projectile)) { + launch = new net.minecraft.world.entity.projectile.DragonFireball(world, this.getHandle(), vec); +- } else if (WindCharge.class.isAssignableFrom(projectile)) { +- launch = EntityType.WIND_CHARGE.create(world); +- ((net.minecraft.world.entity.projectile.windcharge.WindCharge) launch).setOwner(this.getHandle()); +- ((net.minecraft.world.entity.projectile.windcharge.WindCharge) launch).assignDirectionalMovement(vec, 0.1D); ++ // Paper start - more projectile API - correctly launch wind charges ++ } else if (org.bukkit.entity.AbstractWindCharge.class.isAssignableFrom(projectile)) { ++ if (org.bukkit.entity.BreezeWindCharge.class.isAssignableFrom(projectile)) { ++ launch = EntityType.BREEZE_WIND_CHARGE.create(world); ++ } else { ++ launch = EntityType.WIND_CHARGE.create(world); ++ } ++ ((net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge) launch).setOwner(this.getHandle()); ++ ((net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge) launch).shootFromRotation(this.getHandle(), this.getHandle().getXRot(), this.getHandle().getYRot(), 0.0F, 1.5F, 1.0F); // Paper - copied from net.minecraft.world.item.WindChargeItem.use ++ // Paper end - more projectile API - correctly launch wind charges + } else { + launch = new LargeFireball(world, this.getHandle(), vec, 1); + } @@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } else if (Firework.class.isAssignableFrom(projectile)) { Location location = this.getEyeLocation();