feat: build /claimlink command tree stubbed
This commit is contained in:
@@ -0,0 +1,70 @@
|
|||||||
|
using Vintagestory.API.Common;
|
||||||
|
using Vintagestory.API.Server;
|
||||||
|
|
||||||
|
namespace ClaimLink;
|
||||||
|
|
||||||
|
public static class ClaimLinkChatCommand
|
||||||
|
{
|
||||||
|
public static void Register(ICoreServerAPI api)
|
||||||
|
{
|
||||||
|
var p = api.ChatCommands.Parsers;
|
||||||
|
|
||||||
|
var root = api.ChatCommands.Create("claimlink")
|
||||||
|
.WithAlias("clink")
|
||||||
|
.WithDescription("Link vanilla land claims into shared, derived protective territory.")
|
||||||
|
.RequiresPrivilege(Privilege.chat)
|
||||||
|
.RequiresPlayer();
|
||||||
|
|
||||||
|
root.BeginSubCommands("new", "n")
|
||||||
|
.WithDescription("Promote a group you own into a claim link (enters pending state).")
|
||||||
|
.WithArgs(p.Word("groupname"))
|
||||||
|
.HandleWith(_ => TextCommandResult.Success("stub: claimlink new"))
|
||||||
|
.EndSubCommand();
|
||||||
|
|
||||||
|
root.BeginSubCommands("link", "l")
|
||||||
|
.WithDescription("Link a claim you own into the pending or committed claim link.")
|
||||||
|
.WithArgs(p.Word("claim"))
|
||||||
|
.HandleWith(_ => TextCommandResult.Success("stub: claimlink link"))
|
||||||
|
.EndSubCommand();
|
||||||
|
|
||||||
|
root.BeginSubCommands("confirm", "c")
|
||||||
|
.WithDescription("Commit your pending claim link.")
|
||||||
|
.HandleWith(_ => TextCommandResult.Success("stub: claimlink confirm"))
|
||||||
|
.EndSubCommand();
|
||||||
|
|
||||||
|
root.BeginSubCommand("cancel")
|
||||||
|
.WithDescription("Discard your pending claim link.")
|
||||||
|
.HandleWith(_ => TextCommandResult.Success("stub: claimlink cancel"))
|
||||||
|
.EndSubCommand();
|
||||||
|
|
||||||
|
root.BeginSubCommands("unlink", "ul")
|
||||||
|
.WithDescription("Remove a claim you own from its claim link.")
|
||||||
|
.WithArgs(p.Word("claim"))
|
||||||
|
.HandleWith(_ => TextCommandResult.Success("stub: claimlink unlink"))
|
||||||
|
.EndSubCommand();
|
||||||
|
|
||||||
|
root.BeginSubCommand("kick")
|
||||||
|
.WithDescription("Force-unlink another player's claim from the link (Owner/Op).")
|
||||||
|
.WithArgs(p.OnlinePlayer("playername"), p.Word("claim"))
|
||||||
|
.HandleWith(_ => TextCommandResult.Success("stub: claimlink kick"))
|
||||||
|
.EndSubCommand();
|
||||||
|
|
||||||
|
root.BeginSubCommand("delete")
|
||||||
|
.WithDescription("Delete the claim link entirely (Owner).")
|
||||||
|
.WithArgs(p.Word("groupname"))
|
||||||
|
.HandleWith(_ => TextCommandResult.Success("stub: claimlink delete"))
|
||||||
|
.EndSubCommand();
|
||||||
|
|
||||||
|
root.BeginSubCommands("transferownership", "transfer", "to")
|
||||||
|
.WithDescription("Transfer ownership of the claim link to another player (Owner).")
|
||||||
|
.WithArgs(p.Word("groupname"), p.OnlinePlayer("playername"))
|
||||||
|
.HandleWith(_ => TextCommandResult.Success("stub: claimlink transferownership"))
|
||||||
|
.EndSubCommand();
|
||||||
|
|
||||||
|
root.BeginSubCommands("info", "i")
|
||||||
|
.WithDescription("Show a claim link's linked claims, members, and territory (Owner/Op or admin).")
|
||||||
|
.WithArgs(p.Word("groupname"))
|
||||||
|
.HandleWith(_ => TextCommandResult.Success("stub: claimlink info"))
|
||||||
|
.EndSubCommand();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,14 +14,13 @@ public class ClaimLinkModSystem : ModSystem
|
|||||||
{
|
{
|
||||||
cmdListener = new ClaimLinkCommandListener();
|
cmdListener = new ClaimLinkCommandListener();
|
||||||
CommandHookModSystem.Register(cmdListener);
|
CommandHookModSystem.Register(cmdListener);
|
||||||
|
|
||||||
|
ClaimLinkChatCommand.Register(api);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
if (cmdListener == null)
|
if (cmdListener != null)
|
||||||
return;
|
|
||||||
|
|
||||||
CommandHookModSystem.Unregister(cmdListener);
|
CommandHookModSystem.Unregister(cmdListener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"anth64"
|
"anth64"
|
||||||
],
|
],
|
||||||
"description": "Link claims together with groups.",
|
"description": "Link claims together with groups.",
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"game": "1.22.3",
|
"game": "1.22.3",
|
||||||
"commandhook": "2.1.0"
|
"commandhook": "2.1.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user