From 5b324a1a8194a1f9603cd36e518b7c039ea98044 Mon Sep 17 00:00:00 2001 From: asofold Date: Tue, 12 Mar 2013 21:37:14 +0100 Subject: [PATCH] Fix and adjust basic move-debug output. 1. Let the basic move info be printed first, extended info gets printed exra. This allows better printf-debugging, because the move info comes first in any case :). 2. Show "correct" potion-effect strength. --- .../neatmonster/nocheatplus/logging/DebugUtil.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/logging/DebugUtil.java b/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/logging/DebugUtil.java index feb1b912..7aefb652 100644 --- a/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/logging/DebugUtil.java +++ b/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/logging/DebugUtil.java @@ -70,10 +70,13 @@ public class DebugUtil { 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) : "") + ")"); + builder.append(" (" + (speed != Double.NEGATIVE_INFINITY ? ("speed=" + (speed + 1)) : "") + (jump != Double.NEGATIVE_INFINITY ? ("jump=" + (jump + 1)) : "") + ")"); } - + // Print basic info first in order + System.out.print(builder.toString()); + // Extended info. if (BuildParameters.debugLevel > 0){ + builder.setLength(0); // Note: the block flags are for normal on-ground checking, not with yOnGrond set to 0.5. from.collectBlockFlags(maxYOnGround); if (from.getBlockFlags() != 0) builder.append("\nfrom flags: " + StringUtil.join(BlockProperties.getFlagNames(from.getBlockFlags()), "+")); @@ -84,9 +87,10 @@ public class DebugUtil { if (to.getBlockFlags() != 0) builder.append("\nto flags: " + StringUtil.join(BlockProperties.getFlagNames(to.getBlockFlags()), "+")); if (to.getTypeId() != 0) addBlockInfo(builder, to, "\nto"); if (to.getTypeIdBelow() != 0) addBlockBelowInfo(builder, to, "\nto"); - if (!to.isOnGround() && to.isOnGround(0.5)) builder.append(" (ground within 0.5)"); + if (!to.isOnGround() && to.isOnGround(0.5)) builder.append(" (ground within 0.5)"); + System.out.print(builder.toString()); } - System.out.print(builder.toString()); + } public static void addBlockBelowInfo(final StringBuilder builder, final PlayerLocation loc, final String tag) {