mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-13 19:11:22 +01:00
Add in-game debug to fight.critical.
This commit is contained in:
parent
f9691c3ea8
commit
87e350aa81
@ -9,8 +9,10 @@ import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
|
||||
import fr.neatmonster.nocheatplus.checks.moving.MovingListener;
|
||||
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
||||
import fr.neatmonster.nocheatplus.utilities.CheckUtils;
|
||||
import fr.neatmonster.nocheatplus.utilities.PlayerLocation;
|
||||
import fr.neatmonster.nocheatplus.utilities.StringUtil;
|
||||
import fr.neatmonster.nocheatplus.utilities.TickTask;
|
||||
|
||||
/*
|
||||
@ -57,11 +59,19 @@ public class Critical extends Check {
|
||||
CheckUtils.onIllegalMove(player);
|
||||
return true;
|
||||
}
|
||||
final float mcFallDistance = player.getFallDistance();
|
||||
if (mcFallDistance > 0.0 && cc.debug && player.hasPermission(Permissions.ADMINISTRATION_DEBUG)){
|
||||
final MovingData mData = MovingData.getData(player);
|
||||
final MovingConfig mCc = MovingConfig.getConfig(player);
|
||||
if (MovingListener.shouldCheckSurvivalFly(player, mData, mCc) && CheckType.MOVING_NOFALL.isEnabled(player)){
|
||||
// TODO: Set max y in MovingListener, to be independent of sf/nofall!
|
||||
player.sendMessage("Critical: d=" + mcFallDistance + " y=" + location.getY() + ((mData.hasSetBack() && mData.getSetBackY() < mData.noFallMaxY) ? (" jumped=" + StringUtil.fdec3.format(mData.noFallMaxY - mData.getSetBackY())): ""));
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the hit was a critical hit (positive fall distance, entity in the air, not on ladder, not in liquid
|
||||
// and without blindness effect).
|
||||
if (player.getFallDistance() > 0f && !location.isOnGround() && !location.isOnClimbable() && !location.isInLiquid()
|
||||
&& !player.hasPotionEffect(PotionEffectType.BLINDNESS)){
|
||||
if (mcFallDistance > 0f && !location.isOnGround() && !location.isResetCond() && !player.hasPotionEffect(PotionEffectType.BLINDNESS)){
|
||||
// It was a critical hit, now check if the player has jumped or has sent a packet to mislead the server.
|
||||
if (player.getFallDistance() < cc.criticalFallDistance || Math.abs(player.getVelocity().getY()) < cc.criticalVelocity) {
|
||||
final MovingConfig ccM = MovingConfig.getConfig(player);
|
||||
|
Loading…
Reference in New Issue
Block a user