diff options
author | Jake Potrebic <[email protected]> | 2023-09-22 16:26:10 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2023-09-22 16:26:10 -0700 |
commit | 81c5901c674e6ee89dbfed4848c9eb645bfb0f16 (patch) | |
tree | f6c716a6060d6d6a4757ed83ddd600fb40276cdb /patches/server/0939-Fix-DamageCause-for-Falling-Blocks.patch | |
parent | 47aeab84ad94196bc24530ff8ad02342fc16f336 (diff) | |
download | Paper-81c5901c674e6ee89dbfed4848c9eb645bfb0f16.tar.gz Paper-81c5901c674e6ee89dbfed4848c9eb645bfb0f16.zip |
re-add distance map patch
Diffstat (limited to 'patches/server/0939-Fix-DamageCause-for-Falling-Blocks.patch')
-rw-r--r-- | patches/server/0939-Fix-DamageCause-for-Falling-Blocks.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/0939-Fix-DamageCause-for-Falling-Blocks.patch b/patches/server/0939-Fix-DamageCause-for-Falling-Blocks.patch new file mode 100644 index 0000000000..0460fff494 --- /dev/null +++ b/patches/server/0939-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 bdcb1752d0959bbabc17d411f36680bad6669651..9f012b6ccedc2f325f1cb7ee2d4cb843db4e6a41 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -1060,6 +1060,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.FELL_OUT_OF_WORLD)) { |