From b08282d925f1f8e25b1ee698ea8c8e027bc7ea12 Mon Sep 17 00:00:00 2001 From: asofold Date: Fri, 19 Oct 2012 11:41:01 +0200 Subject: [PATCH] Clear NoFall data for quick returns on fall damage, also quick return for cancelled events. --- .../nocheatplus/checks/moving/MovingListener.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index 48b6fd76..4642d383 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -646,10 +646,12 @@ public class MovingListener implements Listener { final Entity entity = event.getEntity(); if (!(entity instanceof Player)) return; final Player player = (Player) entity; - if (!survivalFly.isEnabled(player)) return; - if (!noFall.isEnabled(player)) return; - final MovingConfig cc = MovingConfig.getConfig(player); final MovingData data = MovingData.getData(player); + if (event.isCancelled() || !survivalFly.isEnabled(player) || !noFall.isEnabled(player)){ + data.clearNoFallData(); + return; + } + final MovingConfig cc = MovingConfig.getConfig(player); final float fallDistance = player.getFallDistance(); final int damage = event.getDamage(); final float yDiff = (float) (data.noFallMaxY - player.getLocation().getY());