From 1a59643c02af30a455d03b2d4b1da00e9cfbed55 Mon Sep 17 00:00:00 2001 From: anth64 Date: Tue, 2 Dec 2025 22:35:41 +0100 Subject: [PATCH] Added CommandData class to keep track of who sent the command and what the whole command was. --- CommandHook/CommandData.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 CommandHook/CommandData.cs diff --git a/CommandHook/CommandData.cs b/CommandHook/CommandData.cs new file mode 100644 index 0000000..3c9425d --- /dev/null +++ b/CommandHook/CommandData.cs @@ -0,0 +1,20 @@ +using Vintagestory.API.Server; + +namespace CommandHook; + +public class CommandData +{ + public IServerPlayer? Sender { get; } + public string FullCommand { get; } + public bool IsPlayerCommand { get; } + public bool Cancel { get; set; } + + + public CommandData(IServerPlayer sender, string fullCommand) + { + Sender = sender; + IsPlayerCommand = Sender != null; + FullCommand = fullCommand?.Trim() ?? string.Empty; + Cancel = false; + } +}