diff options
Diffstat (limited to 'patches/unapplied/server/0978-Fix-DamageCause-for-Falling-Blocks.patch')
-rw-r--r-- | patches/unapplied/server/0978-Fix-DamageCause-for-Falling-Blocks.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/unapplied/server/0978-Fix-DamageCause-for-Falling-Blocks.patch b/patches/unapplied/server/0978-Fix-DamageCause-for-Falling-Blocks.patch new file mode 100644 index 0000000000..430a94b984 --- /dev/null +++ b/patches/unapplied/server/0978-Fix-DamageCause-for-Falling-Blocks.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Doc <[email protected]> +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 0f4154560047735562b583081a9edb314f3a8a74..221f5088953b3452966d07eabd4ea8b38c465fd9 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -1030,6 +1030,11 @@ 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)) { |