mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-02 13:57:49 +01:00
Clear NoFall data for quick returns on fall damage, also quick return
for cancelled events.
This commit is contained in:
parent
fbcacf6d40
commit
b08282d925
@ -646,10 +646,12 @@ public class MovingListener implements Listener {
|
|||||||
final Entity entity = event.getEntity();
|
final Entity entity = event.getEntity();
|
||||||
if (!(entity instanceof Player)) return;
|
if (!(entity instanceof Player)) return;
|
||||||
final Player player = (Player) entity;
|
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);
|
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 float fallDistance = player.getFallDistance();
|
||||||
final int damage = event.getDamage();
|
final int damage = event.getDamage();
|
||||||
final float yDiff = (float) (data.noFallMaxY - player.getLocation().getY());
|
final float yDiff = (float) (data.noFallMaxY - player.getLocation().getY());
|
||||||
|
Loading…
Reference in New Issue
Block a user