From a5601e8409554669f459cf48f41eecc9cb0e15ef Mon Sep 17 00:00:00 2001 From: BaiSugar Date: Wed, 27 Apr 2022 10:14:24 +0800 Subject: [PATCH] Update the command format of the usage (including source code) --- README.md | 2 +- README_zh-CN.md | 2 +- .../emu/grasscutter/command/commands/GiveAllCommand.java | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7b92cf407..f327996fc 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ There is a dummy user named "Server" in every player's friends list that you can | drop | drop [amount] | server.drop | Client only | Drops an item around you. | `d` `dropitem` | | give | give [player] [amount] [level] | player.give | Both side | Gives item(s) to you or the specified player. | `g` `item` `giveitem` | | givechar | givechar | player.givechar | Both side | Gives the player a specified character. | givec | -| giveall | giveall | player.giveall | Both side | Gives all items. | givea | +| giveall | giveall [uid] [amount] | player.giveall | Both side | Gives all items. | givea | | godmode | godmode [uid] | player.godmode | Client only | Prevents you from taking damage. | | | heal | heal | player.heal | Client only | Heals all characters in your current team. | h | | help | help [command] | | Both side | Sends the help message or shows information about a specified command. | | diff --git a/README_zh-CN.md b/README_zh-CN.md index 0eb761630..c1e90c27d 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -115,7 +115,7 @@ chmod +x gradlew | drop | drop <物品ID\|物品名称> [数量] | server.drop | 仅客户端 | 在指定玩家周围掉落指定物品 | `d` `dropitem` | | give | give [uid] <物品ID\|物品名称> [数量] [等级] | | | 给予指定玩家一定数量及等级的物品 | `g` `item` `giveitem` | | givechar | givechar <角色ID> [等级] | player.givechar | 均可使用 | 给予指定玩家对应角色 | givec | -| giveall | giveall <数量> | player.giveall | 均可使用 | 给予指定玩家全部物品 | givea | +| giveall | giveall [uid] [数量] | player.giveall | 均可使用 | 给予指定玩家全部物品 | givea | | godmode | godmode [uid] | player.godmode | 仅客户端 | 保护你不受到任何伤害(依然会被击退) | | | heal | heal | player.heal | 仅客户端 | 治疗队伍中所有角色 | h | | help | help [命令] | | 均可使用 | 显示帮助或展示指定命令的帮助 | | diff --git a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java index c81578b43..648828643 100644 --- a/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java @@ -13,7 +13,7 @@ import emu.grasscutter.game.player.Player; import java.util.*; -@Command(label = "giveall", usage = "giveall [player] ", +@Command(label = "giveall", usage = "giveall [player] [amount]", description = "Gives all items", aliases = {"givea"}, permission = "player.giveall", threading = true) public class GiveAllCommand implements CommandHandler { @@ -59,7 +59,7 @@ public class GiveAllCommand implements CommandHandler { break; default: // invalid - CommandHandler.sendMessage(null, "Usage: giveall [player] "); + CommandHandler.sendMessage(null, "Usage: giveall [player] [amount]"); return; } @@ -142,7 +142,7 @@ public class GiveAllCommand implements CommandHandler { } } - if (testItemsList.contains(itemId)) { + if (testItemsList.contains(itemId)) { return true; } @@ -175,7 +175,6 @@ public class GiveAllCommand implements CommandHandler { new Range(2017, 2029), // new Range(108001, 108387) //food }; - private static final Integer[] testItemsIds = new Integer[] { 210, 211, 314, 315, 317, 1005, 1007, 1105, 1107, 1201, 1202, 2800, 100001, 100002, 100244, 100305, 100312, 100313, 101212, 11411, 11506, 11507, 11508, 12505,