Add missing DamageCause for EntityDamageByBlockEvent (#6352)

This commit is contained in:
Jake Potrebic 2021-08-06 23:03:50 -07:00 committed by GitHub
parent a178fb895e
commit 4a2f53c6e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,3 +18,18 @@ index 2519a0f511f0a6065459cd2fe2d9a3e68e55d222..2c334ce3fc3cf86704dee9397166119a
}
super.entityInside(state, world, pos, entity);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index d01d4ca873f8225d3503ecb102ce2eb7bfced421..622a0f23db838b839f76722df0e5480ec927b4a2 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1009,6 +1009,10 @@ public class CraftEventFactory {
cause = DamageCause.HOT_FLOOR;
} else if (source == DamageSource.MAGIC) {
cause = DamageCause.MAGIC;
+ // Paper start
+ } else if (source == DamageSource.IN_FIRE) {
+ cause = DamageCause.FIRE;
+ // Paper end
} else {
throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager, source.msgId));
}