aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1035-Fix-helmet-damage-reduction-inconsistencies.patch
blob: af975bb004852475f9059ebd0c5f2d93e4d013ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Date: Sat, 27 Apr 2024 21:51:58 +0200
Subject: [PATCH] Fix helmet damage reduction inconsistencies

Affect the falling stalactite damage type where the
reduction is not applied like in Vanilla

diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e075770772b84a79f2e05f273f31a4aeb479ff98..34b91eff3190848bae38b20e1d956ece497b1473 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1212,7 +1212,7 @@ public class CraftEventFactory {
         Map<DamageModifier, Function<? super Double, Double>> modifierFunctions = new EnumMap<>(DamageModifier.class);
         modifiers.put(DamageModifier.BASE, rawDamage);
         modifierFunctions.put(DamageModifier.BASE, CraftEventFactory.ZERO);
-        if (source.is(DamageTypes.FALLING_BLOCK) || source.is(DamageTypes.FALLING_ANVIL)) {
+        if (source.is(DamageTypeTags.DAMAGES_HELMET)) { // Paper
             modifiers.put(DamageModifier.HARD_HAT, hardHatModifier);
             modifierFunctions.put(DamageModifier.HARD_HAT, hardHat);
         }