From c7b9f771248bdf84d040480f2e51ff114bf713dd Mon Sep 17 00:00:00 2001 From: caramel <admin@caramel.moe> Date: Sun, 29 Oct 2023 07:50:26 +0900 Subject: [PATCH] Cleanup disable explosion knockback patch (#9858) --- .../server/Disable-explosion-knockback.patch | 25 ------------------- patches/server/Improve-death-events.patch | 2 +- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/patches/server/Disable-explosion-knockback.patch b/patches/server/Disable-explosion-knockback.patch index a30e0836a9..8f0ca38cde 100644 --- a/patches/server/Disable-explosion-knockback.patch +++ b/patches/server/Disable-explosion-knockback.patch @@ -4,31 +4,6 @@ Date: Wed, 2 Mar 2016 14:48:03 -0600 Subject: [PATCH] Disable explosion knockback -diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/LivingEntity.java -+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { - } - } - -+ boolean knockbackCancelled = this.level().paperConfig().environment.disableExplosionKnockback && source.is(DamageTypeTags.IS_EXPLOSION) && this instanceof net.minecraft.world.entity.player.Player; // Paper - Disable explosion knockback - if (flag1) { - if (flag) { - this.level().broadcastEntityEvent(this, (byte) 29); - } else { -+ if (!knockbackCancelled) // Paper - Disable explosion knockback - this.level().broadcastDamageEvent(this, source); - } - -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { - } - } - -+ if (knockbackCancelled) this.level().broadcastEntityEvent(this, (byte) 2); // Paper - Disable explosion knockback - if (this.isDeadOrDying()) { - if (!this.checkTotemDeathProtection(source)) { - SoundEvent soundeffect = this.getDeathSound(); diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java diff --git a/patches/server/Improve-death-events.patch b/patches/server/Improve-death-events.patch index 0cac131542..542d47de30 100644 --- a/patches/server/Improve-death-events.patch +++ b/patches/server/Improve-death-events.patch @@ -82,7 +82,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public float getBukkitYaw() { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { - if (knockbackCancelled) this.level().broadcastEntityEvent(this, (byte) 2); // Paper - Disable explosion knockback + if (this.isDeadOrDying()) { if (!this.checkTotemDeathProtection(source)) { - SoundEvent soundeffect = this.getDeathSound();