mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
pathing: align parkour contracts with live budgets
This commit is contained in:
parent
ce555da95e
commit
cf8bf349db
16 changed files with 3190 additions and 318 deletions
|
|
@ -62,9 +62,28 @@ internal static class PathingContractAssert
|
|||
sb.AppendLine($"seg[{i}] move={actual.MoveType} actual={actual.ElapsedTicks} expected={expected.ExpectedTicks} max={expected.MaxTicks}");
|
||||
}
|
||||
|
||||
if (result.InfoLogs.Count > 0)
|
||||
{
|
||||
sb.AppendLine("info tail:");
|
||||
AppendTail(sb, result.InfoLogs, maxLines: 8);
|
||||
}
|
||||
|
||||
if (result.DebugLogs.Count > 0)
|
||||
{
|
||||
sb.AppendLine("debug tail:");
|
||||
AppendTail(sb, result.DebugLogs, maxLines: 12);
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static void AppendTail(StringBuilder sb, IReadOnlyList<string> lines, int maxLines)
|
||||
{
|
||||
int start = Math.Max(0, lines.Count - maxLines);
|
||||
for (int i = start; i < lines.Count; i++)
|
||||
sb.AppendLine(lines[i]);
|
||||
}
|
||||
|
||||
private static PathingBlock ToBlock(Location location) =>
|
||||
new((int)Math.Floor(location.X), (int)Math.Floor(location.Y), (int)Math.Floor(location.Z));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue