Minecraft-Console-Client/MinecraftClient/Commands/Debug.cs

26 lines
983 B
C#
Raw Normal View History

using System.Collections.Generic;
2022-10-26 08:54:54 +08:00
using Brigadier.NET;
namespace MinecraftClient.Commands
{
public class Debug : Command
{
public override string CmdName { get { return "debug"; } }
public override string CmdUsage { get { return "debug [on|off]"; } }
public override string CmdDesc { get { return "cmd.debug.desc"; } }
2022-10-26 08:54:54 +08:00
public override void RegisterCommand(McClient handler, CommandDispatcher<CommandSource> dispatcher)
{
}
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
{
if (HasArg(command))
2022-10-05 15:02:30 +08:00
Settings.Config.Logging.DebugMessages = (GetArg(command).ToLower() == "on");
else
Settings.Config.Logging.DebugMessages = !Settings.Config.Logging.DebugMessages;
return Translations.Get(Settings.Config.Logging.DebugMessages ? "cmd.debug.state_on" : "cmd.debug.state_off");
}
}
}