From 4ab12f418ed7fc10cd1343f7a0484349b3f9ee8f Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Thu, 21 Apr 2022 11:43:31 +0800 Subject: [PATCH 1/3] add description and permission to setstats command --- .../java/emu/grasscutter/command/commands/SetStatsCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java b/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java index afc1a3e14..e9c4254b6 100644 --- a/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java @@ -10,7 +10,7 @@ import emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify; import java.util.List; @Command(label = "setstats", usage = "setstats|stats ", - aliases = {"stats"}) + description = "Set fight property for the specific player", aliases = {"stats"}, permission = "player.setstats") public final class SetStatsCommand implements CommandHandler { @Override From f3ede17d4d709907e39b3296502f3b227fafd9fa Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Thu, 21 Apr 2022 11:52:53 +0800 Subject: [PATCH 2/3] change description --- .../java/emu/grasscutter/command/commands/SetStatsCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java b/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java index e9c4254b6..78f15de2d 100644 --- a/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java @@ -10,7 +10,7 @@ import emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify; import java.util.List; @Command(label = "setstats", usage = "setstats|stats ", - description = "Set fight property for the specific player", aliases = {"stats"}, permission = "player.setstats") + description = "Set fight property for your current active character", aliases = {"stats"}, permission = "player.setstats") public final class SetStatsCommand implements CommandHandler { @Override From 7fcaa97a6a9dc9284d420eb2befbccfd50eeb04c Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Thu, 21 Apr 2022 12:49:23 +0800 Subject: [PATCH 3/3] add args check --- .../emu/grasscutter/command/commands/SetStatsCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java b/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java index 78f15de2d..e3efdb0d5 100644 --- a/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java @@ -20,6 +20,11 @@ public final class SetStatsCommand implements CommandHandler { return; } + if (args.size() < 2){ + CommandHandler.sendMessage(sender, "Usage: setstats|stats "); + return; + } + String stat = args.get(0); switch (stat) { default: