diff options
author | Pedro <[email protected]> | 2023-05-03 06:50:59 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-05-03 11:50:59 +0100 |
commit | 83da4b6101c403792ba1cc8c71b58dea6e9ddd16 (patch) | |
tree | 6f7973dffa268d6a45fe36d269ea021e526cd366 | |
parent | 4f9575eed827007f31ce17da471820fe8bc14573 (diff) | |
download | Paper-83da4b6101c403792ba1cc8c71b58dea6e9ddd16.tar.gz Paper-83da4b6101c403792ba1cc8c71b58dea6e9ddd16.zip |
Fix DamageSource for Falling Blocks (#9175)
-rw-r--r-- | patches/server/0977-Fix-DamageCause-for-Falling-Blocks.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/0977-Fix-DamageCause-for-Falling-Blocks.patch b/patches/server/0977-Fix-DamageCause-for-Falling-Blocks.patch new file mode 100644 index 0000000000..0f713f319e --- /dev/null +++ b/patches/server/0977-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 819c9c020f4d5a1373f68850134960d24b8fc308..dee0168b50c7fbaefb762939a04e8f51e7bc58f7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -1028,6 +1028,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)) { |