diff options
author | Jake Potrebic <[email protected]> | 2024-05-30 12:57:55 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-05-30 12:57:55 -0700 |
commit | 14c03162ee6a630ea7b13d752e8ab3de9e1cbdde (patch) | |
tree | f83899096c8ebb3b28a6754f5f700c9db4779f8b | |
parent | 561fda88a86a274ecc7725c95a31da762f6120b2 (diff) | |
download | Paper-fix/knockback-events.tar.gz Paper-fix/knockback-events.zip |
handle cancelled event for explosionsfix/knockback-events
-rw-r--r-- | patches/server/0204-Add-entity-knockback-events.patch | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/patches/server/0204-Add-entity-knockback-events.patch b/patches/server/0204-Add-entity-knockback-events.patch index eb87d39471..7733d53d02 100644 --- a/patches/server/0204-Add-entity-knockback-events.patch +++ b/patches/server/0204-Add-entity-knockback-events.patch @@ -252,7 +252,7 @@ index 9f9b7373c9a714597858ddcd8932e31b902cf5a1..f7f26d595072372004143c4e26506ed5 public abstract void explode(); diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index da9a9b235d1c8bcab3762134d69dcb112470e55d..b1e4aa81c81357e0a5b0c9759c67960a7b937892 100644 +index da9a9b235d1c8bcab3762134d69dcb112470e55d..d15f216193613504c456d63a1c358973afad3ed1 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -296,13 +296,10 @@ public class Explosion { @@ -268,7 +268,7 @@ index da9a9b235d1c8bcab3762134d69dcb112470e55d..b1e4aa81c81357e0a5b0c9759c67960a - vec3d1 = (event.isCancelled()) ? Vec3.ZERO : new Vec3(event.getFinalKnockback().getX(), event.getFinalKnockback().getY(), event.getFinalKnockback().getZ()).subtract(entity.getDeltaMovement()); + // Paper start - knockback events + io.papermc.paper.event.entity.EntityKnockbackEvent event = CraftEventFactory.callEntityKnockbackEvent((org.bukkit.craftbukkit.entity.CraftLivingEntity) entity.getBukkitEntity(), this.damageSource.getEntity() != null ? this.damageSource.getEntity() : this.source, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.EXPLOSION, d13, vec3d1); -+ vec3d1 = org.bukkit.craftbukkit.util.CraftVector.toNMS(event.getKnockback()); ++ vec3d1 = event.isCancelled() ? Vec3.ZERO : org.bukkit.craftbukkit.util.CraftVector.toNMS(event.getKnockback()); + // Paper end - knockback events } // CraftBukkit end |