mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-26 20:45:43 +01:00
Treat elytra wall impact as fall damage.
Fixes WORLDGUARD-3654.
This commit is contained in:
parent
f5a554f4a4
commit
e9ecb6d2a8
@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user