From b2a28c54bbe61b122d6d8f32233e6d7e1e36f6a2 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 29 Aug 2024 07:23:29 +1000 Subject: [PATCH] SPIGOT-7887: Remove duplicate ProjectileHitEvent for fireballs By: md_5 --- .../world/entity/projectile/EntityFireball.patch | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityFireball.patch b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityFireball.patch index 7297681d7c..30b743bb2f 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityFireball.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityFireball.patch @@ -1,11 +1,10 @@ --- a/net/minecraft/world/entity/projectile/EntityFireball.java +++ b/net/minecraft/world/entity/projectile/EntityFireball.java -@@ -18,11 +18,18 @@ +@@ -18,11 +18,17 @@ import net.minecraft.world.phys.MovingObjectPosition; import net.minecraft.world.phys.Vec3D; +// CraftBukkit start -+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.event.entity.EntityRemoveEvent; +// CraftBukkit end + @@ -19,7 +18,7 @@ protected EntityFireball(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -71,7 +78,7 @@ +@@ -71,7 +77,7 @@ Entity entity = this.getOwner(); if (!this.level().isClientSide && (entity != null && entity.isRemoved() || !this.level().hasChunkAt(this.blockPosition()))) { @@ -28,18 +27,12 @@ } else { super.tick(); if (this.shouldBurn()) { -@@ -81,7 +88,13 @@ +@@ -81,7 +87,7 @@ MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType()); if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { - this.hitTargetOrDeflectSelf(movingobjectposition); + this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event -+ -+ // CraftBukkit start - Fire ProjectileHitEvent -+ if (this.isRemoved()) { -+ CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); -+ } -+ // CraftBukkit end } this.checkInsideBlocks();