From 9b4ad2a45fd7fca22dcc787d1146e4bd33a1601f Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 9 Jun 2016 12:45:07 +1000 Subject: [PATCH] Add DamageCause.HOT_FLOOR --- .../org/bukkit/craftbukkit/event/CraftEventFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 2961e0dc70..cc488ccc61 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -483,8 +483,8 @@ public class CraftEventFactory { event.getEntity().setLastDamageCause(event); } return event; - } else if (source == DamageSource.LAVA) { - EntityDamageEvent event = callEvent(new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions)); + } else if (source == DamageSource.LAVA || source == DamageSource.HOT_FLOOR) { + EntityDamageEvent event = callEvent(new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), (source == DamageSource.LAVA) ? DamageCause.LAVA : DamageCause.HOT_FLOOR, modifiers, modifierFunctions)); if (!event.isCancelled()) { event.getEntity().setLastDamageCause(event); } @@ -493,7 +493,7 @@ public class CraftEventFactory { DamageCause cause = null; Block damager = blockDamage; blockDamage = null; - if (source == DamageSource.CACTUS || source == DamageSource.HOT_FLOOR) { + if (source == DamageSource.CACTUS) { cause = DamageCause.CONTACT; } else { throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager, source.translationIndex));