mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
init
This commit is contained in:
parent
a1259edcae
commit
f8aefaf129
39 changed files with 353 additions and 66 deletions
|
|
@ -1,4 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Brigadier.NET;
|
||||
using Brigadier.NET.Builder;
|
||||
|
||||
namespace MinecraftClient.Commands
|
||||
{
|
||||
|
|
@ -8,6 +11,48 @@ namespace MinecraftClient.Commands
|
|||
public override string CmdUsage { get { return "animation <mainhand|offhand>"; } }
|
||||
public override string CmdDesc { get { return "cmd.animation.desc"; } }
|
||||
|
||||
public override void RegisterCommand(McClient handler, CommandDispatcher<CommandSource> dispatcher)
|
||||
{
|
||||
dispatcher.Register(l =>
|
||||
l.Literal("help").Then(l =>
|
||||
l.Literal(CmdName).Executes(c => {
|
||||
LogUsage(handler.Log);
|
||||
return 1;
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
dispatcher.Register(l =>
|
||||
l.Literal(CmdName).Then(l =>
|
||||
l.Literal("mainhand")
|
||||
.Executes(c => {
|
||||
return LogExecuteResult(handler.Log, handler.DoAnimation(0));
|
||||
})
|
||||
)
|
||||
);
|
||||
dispatcher.Register(l =>
|
||||
l.Literal(CmdName).Then(l =>
|
||||
l.Literal("0")
|
||||
.Redirect(dispatcher.GetRoot().GetChild(CmdName).GetChild("mainhand"))
|
||||
)
|
||||
);
|
||||
|
||||
dispatcher.Register(l =>
|
||||
l.Literal(CmdName).Then(l =>
|
||||
l.Literal("offhand")
|
||||
.Executes(c => {
|
||||
return LogExecuteResult(handler.Log, handler.DoAnimation(1));
|
||||
})
|
||||
)
|
||||
);
|
||||
dispatcher.Register(l =>
|
||||
l.Literal(CmdName).Then(l =>
|
||||
l.Literal("1")
|
||||
.Redirect(dispatcher.GetRoot().GetChild(CmdName).GetChild("offhand"))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
|
||||
{
|
||||
if (HasArg(command))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue