diff options
Diffstat (limited to 'patches/server/1030-Fix-shield-disable-inconsistency.patch')
-rw-r--r-- | patches/server/1030-Fix-shield-disable-inconsistency.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/1030-Fix-shield-disable-inconsistency.patch b/patches/server/1030-Fix-shield-disable-inconsistency.patch new file mode 100644 index 0000000000..757be91657 --- /dev/null +++ b/patches/server/1030-Fix-shield-disable-inconsistency.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Fri, 26 Apr 2024 19:08:37 -0700 +Subject: [PATCH] Fix shield disable inconsistency + +In vanilla, if the damage source is tagged as a projectile, +it will not disable the shield if the attacker is holding +an axe item. + +diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java +index ca242ba1312263ec095fa2850dc0f02351e844ab..2338e41fde55559249d5f212697235e789b20b2a 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -2341,7 +2341,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING)); + Entity entity = damagesource.getDirectEntity(); + +- if (entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Improve boat collision performance ++ if (!damagesource.is(DamageTypeTags.IS_PROJECTILE) && entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Improve boat collision performance + this.blockUsingShield((LivingEntity) entity); + } + } |