mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-06 18:50:54 +01:00
Ignore players in vehicles with the fall damage events.
This commit is contained in:
parent
ea682417bc
commit
c9b2ae1a3d
@ -1103,11 +1103,20 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
|
||||
public void onEntityDamage(final EntityDamageEvent event) {
|
||||
if (event.getCause() != DamageCause.FALL) return;
|
||||
if (event.getCause() != DamageCause.FALL) {
|
||||
return;
|
||||
}
|
||||
final Entity entity = event.getEntity();
|
||||
if (!(entity instanceof Player)) return;
|
||||
if (!(entity instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
final Player player = (Player) entity;
|
||||
final MovingData data = MovingData.getData(player);
|
||||
if (player.isInsideVehicle()) {
|
||||
// Ignore vehicles (noFallFallDistance will be inaccurate anyway).
|
||||
data.clearNoFallData();
|
||||
return;
|
||||
}
|
||||
final MovingConfig cc = MovingConfig.getConfig(player);
|
||||
if (event.isCancelled() || !shouldCheckSurvivalFly(player, data, cc) || !noFall.isEnabled(player)) {
|
||||
data.clearNoFallData();
|
||||
|
Loading…
Reference in New Issue
Block a user