aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0958-Fix-shield-disable-inconsistency.patch
blob: 624805ae3f738cd141cedc5fb6b57d9ab239b921 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
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 474868d362d855423f74fd604c1050cf33ba27f3..5954476f7cbec585f142ee209e91d5b70bb7a8a6 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2349,7 +2349,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
                 this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING));
                 Entity entity = damagesource.getDirectEntity();
 
-                if (entity instanceof LivingEntity) {
+                if (!damagesource.is(DamageTypeTags.IS_PROJECTILE) && entity instanceof LivingEntity) { // Paper - Fix shield disable inconsistency
                     this.blockUsingShield((LivingEntity) entity);
                 }
             }