2023-05-03 12:50:59 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Doc <nachito94@msn.com>
|
|
|
|
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
|
2023-10-03 13:55:12 +02:00
|
|
|
index c562b5b4048e68a62d114a4a928dff3c956d679a..82a474a09905e9858e0a7b4b00839f5ad5e9adbb 100644
|
2023-05-03 12:50:59 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2023-09-22 18:11:35 +02:00
|
|
|
@@ -1060,6 +1060,11 @@ public class CraftEventFactory {
|
2023-05-03 12:50:59 +02:00
|
|
|
} 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
|
2023-06-08 10:47:19 +02:00
|
|
|
} else if (source.is(DamageTypes.FELL_OUT_OF_WORLD)) {
|