diff options
author | Jake Potrebic <[email protected]> | 2024-06-13 10:12:48 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-06-13 10:12:48 -0700 |
commit | 8a37f93925f5a0274745f81bb6d4ee8473551abf (patch) | |
tree | 5862d5be3fabfa84ab538d983e3daaddfb59b858 /patches/server/0045-Disable-explosion-knockback.patch | |
parent | 7fbb8278e70c1904e09f2144f0e3897468a4906f (diff) | |
download | Paper-8a37f93925f5a0274745f81bb6d4ee8473551abf.tar.gz Paper-8a37f93925f5a0274745f81bb6d4ee8473551abf.zip |
62
Diffstat (limited to 'patches/server/0045-Disable-explosion-knockback.patch')
-rw-r--r-- | patches/server/0045-Disable-explosion-knockback.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/0045-Disable-explosion-knockback.patch b/patches/server/0045-Disable-explosion-knockback.patch new file mode 100644 index 0000000000..233aa30581 --- /dev/null +++ b/patches/server/0045-Disable-explosion-knockback.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sudzzy <[email protected]> +Date: Wed, 2 Mar 2016 14:48:03 -0600 +Subject: [PATCH] Disable explosion knockback + + +diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java +index 55d66aa8264d5b444a23e2132206bcc9835cfe00..d93ed33d5ae72e9dd3e6cf044ef79e4b9689dc1c 100644 +--- a/src/main/java/net/minecraft/world/level/Explosion.java ++++ b/src/main/java/net/minecraft/world/level/Explosion.java +@@ -285,7 +285,7 @@ public class Explosion { + if (entity instanceof LivingEntity) { + LivingEntity entityliving = (LivingEntity) entity; + +- d13 = d12 * (1.0D - entityliving.getAttributeValue(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE)); ++ d13 = entity instanceof Player && this.level.paperConfig().environment.disableExplosionKnockback ? 0 : d12 * (1.0D - entityliving.getAttributeValue(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE)); + } else { + d13 = d12; + } +@@ -310,7 +310,7 @@ public class Explosion { + if (entity instanceof Player) { + Player entityhuman = (Player) entity; + +- if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying)) { ++ if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying) && !level.paperConfig().environment.disableExplosionKnockback) { // Paper - Option to disable explosion knockback + this.hitPlayers.put(entityhuman, vec3d1); + } + } |