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

42 lines
1.4 KiB
C#
Raw Normal View History

using System.Collections.Generic;
2020-05-26 14:02:09 +05:00
namespace MinecraftClient.Commands
{
public class Animation : Command
{
public override string CmdName { get { return "animation"; } }
public override string CmdUsage { get { return "animation <mainhand|offhand>"; } }
public override string CmdDesc { get { return Translations.cmd_animation_desc; } }
2020-05-26 14:02:09 +05:00
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
2020-05-26 14:02:09 +05:00
{
if (HasArg(command))
2020-05-26 14:02:09 +05:00
{
string[] args = GetArgs(command);
2020-05-26 14:02:09 +05:00
if (args.Length > 0)
{
if (args[0] == "mainhand" || args[0] == "0")
{
handler.DoAnimation(0);
return Translations.general_done;
2020-05-26 14:02:09 +05:00
}
else if (args[0] == "offhand" || args[0] == "1")
{
handler.DoAnimation(1);
return Translations.general_done;
2020-05-26 14:02:09 +05:00
}
else
{
return GetCmdDescTranslated();
2020-05-26 14:02:09 +05:00
}
}
else
{
return GetCmdDescTranslated();
2020-05-26 14:02:09 +05:00
}
}
else return GetCmdDescTranslated();
2020-05-26 14:02:09 +05:00
}
}
}