From af12848e7062a78e902bc7706c329e4f6c1c631b Mon Sep 17 00:00:00 2001 From: Pedro <3602279+Doc94@users.noreply.github.com> Date: Wed, 3 May 2023 06:50:59 -0400 Subject: [PATCH] Fix DamageSource for Falling Blocks (#9175) --- .../Fix-DamageCause-for-Falling-Blocks.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patches/server/Fix-DamageCause-for-Falling-Blocks.patch diff --git a/patches/server/Fix-DamageCause-for-Falling-Blocks.patch b/patches/server/Fix-DamageCause-for-Falling-Blocks.patch new file mode 100644 index 0000000000..f71aaabfcf --- /dev/null +++ b/patches/server/Fix-DamageCause-for-Falling-Blocks.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Doc +Date: Mon, 1 May 2023 13:34:57 -0400 +Subject: [PATCH] Fix DamageCause for Falling Blocks + + +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -0,0 +0,0 @@ public class CraftEventFactory { + } else if (source.is(DamageTypes.SONIC_BOOM)) { + cause = DamageCause.SONIC_BOOM; + } ++ // Paper start - fix handle of Falling Blocks ++ else if (source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_BLOCK) || source.is(DamageTypes.FALLING_ANVIL)) { ++ cause = DamageCause.FALLING_BLOCK; ++ } ++ // Paper end + + return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API + } else if (source.is(DamageTypes.OUT_OF_WORLD)) {