mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed BlockInfo overwrite.
This commit is contained in:
parent
a4175d2981
commit
428c5eb71e
1 changed files with 18 additions and 8 deletions
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
||||||
public override string CmdUsage { get { return "blockinfo <x> <y> <z> [-s]"; } }
|
public override string CmdUsage { get { return "blockinfo <x> <y> <z> [-s]"; } }
|
||||||
public override string CmdDesc { get { return "cmd.blockinfo.desc"; } }
|
public override string CmdDesc { get { return "cmd.blockinfo.desc"; } }
|
||||||
|
|
||||||
public override string Run(McClient handler, string command, Dictionary<string, object> localVars)
|
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
|
||||||
{
|
{
|
||||||
if (!handler.GetTerrainEnabled())
|
if (!handler.GetTerrainEnabled())
|
||||||
return Translations.TryGet("error.terrain_not_enabled");
|
return Translations.TryGet("error.terrain_not_enabled");
|
||||||
|
|
@ -27,7 +27,7 @@ namespace MinecraftClient.Commands
|
||||||
|
|
||||||
Block block = handler.GetWorld().GetBlock(targetBlockLocation);
|
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)
|
if (reportSurrounding)
|
||||||
{
|
{
|
||||||
|
|
@ -41,14 +41,24 @@ namespace MinecraftClient.Commands
|
||||||
Block blockZPositive = handler.GetWorld().GetBlock(new Location(targetBlockLocation.X, targetBlockLocation.Y, targetBlockLocation.Z + 1));
|
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));
|
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.Positive") + "] " +
|
||||||
sb.AppendLine("[X " + Translations.TryGet("cmd.blockinfo.Negative") + "] " + Translations.TryGet("cmd.blockinfo.BlockType") + ": " + blockXNegative.Type);
|
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(" ");
|
||||||
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(" ");
|
||||||
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());
|
handler.Log.Info(sb.ToString());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue