2022-10-02 18:31:08 +08:00
|
|
|
|
using System.Collections.Generic;
|
2020-05-26 14:02:09 +05:00
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Commands
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Animation : Command
|
|
|
|
|
|
{
|
2020-10-17 19:41:31 +08:00
|
|
|
|
public override string CmdName { get { return "animation"; } }
|
|
|
|
|
|
public override string CmdUsage { get { return "animation <mainhand|offhand>"; } }
|
|
|
|
|
|
public override string CmdDesc { get { return "cmd.animation.desc"; } }
|
2020-05-26 14:02:09 +05:00
|
|
|
|
|
2022-10-02 18:31:08 +08:00
|
|
|
|
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
|
2020-05-26 14:02:09 +05:00
|
|
|
|
{
|
2022-10-02 18:31:08 +08:00
|
|
|
|
if (HasArg(command))
|
2020-05-26 14:02:09 +05:00
|
|
|
|
{
|
2022-10-02 18:31:08 +08: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);
|
2020-10-17 19:41:31 +08:00
|
|
|
|
return Translations.Get("general.done");
|
2020-05-26 14:02:09 +05:00
|
|
|
|
}
|
|
|
|
|
|
else if (args[0] == "offhand" || args[0] == "1")
|
|
|
|
|
|
{
|
|
|
|
|
|
handler.DoAnimation(1);
|
2020-10-17 19:41:31 +08:00
|
|
|
|
return Translations.Get("general.done");
|
2020-05-26 14:02:09 +05:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2020-10-17 19:41:31 +08:00
|
|
|
|
return GetCmdDescTranslated();
|
2020-05-26 14:02:09 +05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2020-10-17 19:41:31 +08:00
|
|
|
|
return GetCmdDescTranslated();
|
2020-05-26 14:02:09 +05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-10-17 19:41:31 +08:00
|
|
|
|
else return GetCmdDescTranslated();
|
2020-05-26 14:02:09 +05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|