Treat elytra wall impact as fall damage.

Fixes WORLDGUARD-3654.
This commit is contained in:
wizjany 2016-06-11 11:29:01 -04:00
parent f5a554f4a4
commit e9ecb6d2a8

View File

@ -119,6 +119,15 @@ public void onEntityDamage(EntityDamageEvent event) {
if (!query.testState(entity.getLocation(), (Player) entity, DefaultFlag.FALL_DAMAGE)) {
event.setCancelled(true);
}
} else {
try {
if (entity instanceof Player && event.getCause() == DamageCause.FLY_INTO_WALL) {
if (!query.testState(entity.getLocation(), (Player) entity, DefaultFlag.FALL_DAMAGE)) {
event.setCancelled(true);
}
}
} catch (NoSuchFieldError ignored) {
}
}
}