mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
Add DamageCause.HOT_FLOOR
This commit is contained in:
parent
8b94601269
commit
9b4ad2a45f
@ -483,8 +483,8 @@ public class CraftEventFactory {
|
|||||||
event.getEntity().setLastDamageCause(event);
|
event.getEntity().setLastDamageCause(event);
|
||||||
}
|
}
|
||||||
return event;
|
return event;
|
||||||
} else if (source == DamageSource.LAVA) {
|
} else if (source == DamageSource.LAVA || source == DamageSource.HOT_FLOOR) {
|
||||||
EntityDamageEvent event = callEvent(new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions));
|
EntityDamageEvent event = callEvent(new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), (source == DamageSource.LAVA) ? DamageCause.LAVA : DamageCause.HOT_FLOOR, modifiers, modifierFunctions));
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
event.getEntity().setLastDamageCause(event);
|
event.getEntity().setLastDamageCause(event);
|
||||||
}
|
}
|
||||||
@ -493,7 +493,7 @@ public class CraftEventFactory {
|
|||||||
DamageCause cause = null;
|
DamageCause cause = null;
|
||||||
Block damager = blockDamage;
|
Block damager = blockDamage;
|
||||||
blockDamage = null;
|
blockDamage = null;
|
||||||
if (source == DamageSource.CACTUS || source == DamageSource.HOT_FLOOR) {
|
if (source == DamageSource.CACTUS) {
|
||||||
cause = DamageCause.CONTACT;
|
cause = DamageCause.CONTACT;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager, source.translationIndex));
|
throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager, source.translationIndex));
|
||||||
|
Loading…
Reference in New Issue
Block a user