From 428c5eb71e3f07991222b45b11a9ee91f9bfa069 Mon Sep 17 00:00:00 2001 From: Milutinke Date: Mon, 17 Oct 2022 16:17:23 +0200 Subject: [PATCH] Fixed BlockInfo overwrite. --- MinecraftClient/Commands/BlockInfo.cs | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/MinecraftClient/Commands/BlockInfo.cs b/MinecraftClient/Commands/BlockInfo.cs index 36e2d723..5aa8ec75 100644 --- a/MinecraftClient/Commands/BlockInfo.cs +++ b/MinecraftClient/Commands/BlockInfo.cs @@ -10,7 +10,7 @@ namespace MinecraftClient.Commands public override string CmdUsage { get { return "blockinfo [-s]"; } } public override string CmdDesc { get { return "cmd.blockinfo.desc"; } } - public override string Run(McClient handler, string command, Dictionary localVars) + public override string Run(McClient handler, string command, Dictionary? localVars) { if (!handler.GetTerrainEnabled()) return Translations.TryGet("error.terrain_not_enabled"); @@ -27,7 +27,7 @@ namespace MinecraftClient.Commands Block block = handler.GetWorld().GetBlock(targetBlockLocation); - handler.Log.Info(Translations.TryGet("cmd.blockinfo.BlockType") + ": " + block.Type); + handler.Log.Info(Translations.TryGet("cmd.blockinfo.BlockType") + ": " + block.GetTypeString()); if (reportSurrounding) { @@ -41,14 +41,24 @@ namespace MinecraftClient.Commands Block blockZPositive = handler.GetWorld().GetBlock(new Location(targetBlockLocation.X, targetBlockLocation.Y, targetBlockLocation.Z + 1)); Block blockZNegative = handler.GetWorld().GetBlock(new Location(targetBlockLocation.X, targetBlockLocation.Y, targetBlockLocation.Z - 1)); - sb.AppendLine("[X " + Translations.TryGet("cmd.blockinfo.Positive") + "] " + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockXPositive.Type); - sb.AppendLine("[X " + Translations.TryGet("cmd.blockinfo.Negative") + "] " + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockXNegative.Type); + sb.AppendLine("[X " + Translations.TryGet("cmd.blockinfo.Positive") + "] " + + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockXPositive.GetTypeString()); + sb.AppendLine("[X " + Translations.TryGet("cmd.blockinfo.Negative") + "] " + + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockXNegative.GetTypeString()); + sb.AppendLine(" "); - sb.AppendLine("[Y " + Translations.TryGet("cmd.blockinfo.Positive") + "] " + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockYPositive.Type); - sb.AppendLine("[Y " + Translations.TryGet("cmd.blockinfo.Negative") + "] " + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockYNegative.Type); + + sb.AppendLine("[Y " + Translations.TryGet("cmd.blockinfo.Positive") + "] " + + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockYPositive.GetTypeString()); + sb.AppendLine("[Y " + Translations.TryGet("cmd.blockinfo.Negative") + "] " + + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockYNegative.GetTypeString()); + sb.AppendLine(" "); - sb.AppendLine("[Z " + Translations.TryGet("cmd.blockinfo.Positive") + "] " + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockZPositive.Type); - sb.AppendLine("[Z " + Translations.TryGet("cmd.blockinfo.Negative") + "] " + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockZNegative.Type); + + sb.AppendLine("[Z " + Translations.TryGet("cmd.blockinfo.Positive") + "] " + + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockZPositive.GetTypeString()); + sb.AppendLine("[Z " + Translations.TryGet("cmd.blockinfo.Negative") + "] " + + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockZNegative.GetTypeString()); handler.Log.Info(sb.ToString()); }