Clear NoFall data for quick returns on fall damage, also quick return

for cancelled events.
This commit is contained in:
asofold 2012-10-19 11:41:01 +02:00
parent fbcacf6d40
commit b08282d925

View File

@ -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());