mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-03 19:00:30 +02:00
Move some debug output to a method.
This commit is contained in:
parent
dd9e5d3873
commit
bcd62f09a8
|
@ -489,19 +489,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||||
moveInfo.set(player, from, to, cc.yOnGround);
|
moveInfo.set(player, from, to, cc.yOnGround);
|
||||||
|
|
||||||
if (cc.debug) {
|
if (cc.debug) {
|
||||||
final StringBuilder builder = new StringBuilder(250);
|
outputMoveDebug(player, pFrom, pTo);
|
||||||
final Location loc = player.getLocation();
|
|
||||||
builder.append(player.getName());
|
|
||||||
builder.append(" " + from.getWorld().getName() + " " + StringUtil.fdec3.format(from.getX()) + (from.getX() == loc.getX() ? "" : ("(" + StringUtil.fdec3.format(loc.getX()) + ")")));
|
|
||||||
builder.append(", " + StringUtil.fdec3.format(from.getY()) + (from.getY() == loc.getY() ? "" : ("(" + StringUtil.fdec3.format(loc.getY()) + ")")));
|
|
||||||
builder.append(", " + StringUtil.fdec3.format(from.getZ()) + (from.getZ() == loc.getZ() ? "" : ("(" + StringUtil.fdec3.format(loc.getZ()) + ")")));
|
|
||||||
builder.append(" -> " + StringUtil.fdec3.format(to.getX()) + ", " + StringUtil.fdec3.format(to.getY()) + ", " + StringUtil.fdec3.format(to.getZ()));
|
|
||||||
final double jump = mcAccess.getJumpAmplifier(player);
|
|
||||||
final double speed = mcAccess.getFasterMovementAmplifier(player);
|
|
||||||
if (speed != Double.NEGATIVE_INFINITY || jump != Double.NEGATIVE_INFINITY){
|
|
||||||
builder.append(" (" + (speed != Double.NEGATIVE_INFINITY ? ("speed=" + speed) : "") + (jump != Double.NEGATIVE_INFINITY ? ("jump=" + jump) : "") + ")");
|
|
||||||
}
|
|
||||||
System.out.print(builder.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data.noFallAssumeGround = false;
|
data.noFallAssumeGround = false;
|
||||||
|
@ -666,7 +654,23 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||||
// event.setTo(event.getFrom()); // TODO: revise this (old!) strategy, cancelled events just teleport to from, basically.
|
// event.setTo(event.getFrom()); // TODO: revise this (old!) strategy, cancelled events just teleport to from, basically.
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
private void outputMoveDebug(final Player player, final PlayerLocation from, final PlayerLocation to) {
|
||||||
|
final StringBuilder builder = new StringBuilder(250);
|
||||||
|
final Location loc = player.getLocation();
|
||||||
|
builder.append(player.getName());
|
||||||
|
builder.append(" " + from.getWorld().getName() + " " + StringUtil.fdec3.format(from.getX()) + (from.getX() == loc.getX() ? "" : ("(" + StringUtil.fdec3.format(loc.getX()) + ")")));
|
||||||
|
builder.append(", " + StringUtil.fdec3.format(from.getY()) + (from.getY() == loc.getY() ? "" : ("(" + StringUtil.fdec3.format(loc.getY()) + ")")));
|
||||||
|
builder.append(", " + StringUtil.fdec3.format(from.getZ()) + (from.getZ() == loc.getZ() ? "" : ("(" + StringUtil.fdec3.format(loc.getZ()) + ")")));
|
||||||
|
builder.append(" -> " + StringUtil.fdec3.format(to.getX()) + ", " + StringUtil.fdec3.format(to.getY()) + ", " + StringUtil.fdec3.format(to.getZ()));
|
||||||
|
final double jump = mcAccess.getJumpAmplifier(player);
|
||||||
|
final double speed = mcAccess.getFasterMovementAmplifier(player);
|
||||||
|
if (speed != Double.NEGATIVE_INFINITY || jump != Double.NEGATIVE_INFINITY){
|
||||||
|
builder.append(" (" + (speed != Double.NEGATIVE_INFINITY ? ("speed=" + speed) : "") + (jump != Double.NEGATIVE_INFINITY ? ("jump=" + jump) : "") + ")");
|
||||||
|
}
|
||||||
|
System.out.print(builder.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* Monitor level PlayerMoveEvent.
|
* Monitor level PlayerMoveEvent.
|
||||||
* @param event
|
* @param event
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user