forked from PaperMC/Paper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Call ProjectileHitEvent for entity hits (PaperMC#11652)
A simple bugfix replacing a new vanilla call to Projectile#hitTargetOrDeflectSelf with the bukkit replacement to call the event.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
patches/server/1071-Call-ProjectileHitEvent-for-entity-hits.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Bjarne Koll <[email protected]> | ||
Date: Sat, 23 Nov 2024 22:48:26 +0100 | ||
Subject: [PATCH] Call ProjectileHitEvent for entity hits | ||
|
||
A simple bugfix replacing a new vanilla call to | ||
Projectile#hitTargetOrDeflectSelf with the bukkit replacement to call | ||
the event. | ||
|
||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java | ||
index accc246f441c8bf5e1a755cfc0db8f97c0c01c6b..571f0699772eecbe02d71845da82a142321f2142 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java | ||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java | ||
@@ -309,7 +309,7 @@ public abstract class AbstractArrow extends Projectile { | ||
continue; | ||
} | ||
|
||
- ProjectileDeflection projectiledeflection = this.hitTargetOrDeflectSelf(movingobjectpositionentity); | ||
+ ProjectileDeflection projectiledeflection = this.preHitTargetOrDeflectSelf(movingobjectpositionentity); // Paper - also call projectile hit event | ||
|
||
this.hasImpulse = true; | ||
if (this.getPierceLevel() > 0 && projectiledeflection == ProjectileDeflection.NONE) { |