Skip to content

Commit 504e4fb

Browse files
authored
Fix commands with alias and subcommands (#3)
1 parent efc97cb commit 504e4fb

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/main/java/tc/oc/occ/cheaty/commands/AdminCommands.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
import co.aikar.commands.annotation.CommandPermission;
66
import co.aikar.commands.annotation.Dependency;
77
import co.aikar.commands.annotation.Description;
8+
import co.aikar.commands.annotation.Subcommand;
89
import org.bukkit.ChatColor;
910
import org.bukkit.command.CommandSender;
1011
import tc.oc.occ.cheaty.Cheaty;
1112

13+
@CommandAlias("cheaty")
1214
public class AdminCommands extends BaseCommand {
1315

1416
@Dependency private Cheaty plugin;
1517

16-
@CommandAlias("cheaty")
18+
@Subcommand("reload")
1719
@Description("Reload cheaty config")
1820
@CommandPermission("cheaty.admin")
1921
public void reload(CommandSender sender) {

src/main/java/tc/oc/occ/cheaty/commands/BotCommands.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
import co.aikar.commands.annotation.CommandAlias;
55
import co.aikar.commands.annotation.CommandPermission;
66
import co.aikar.commands.annotation.Dependency;
7+
import co.aikar.commands.annotation.Subcommand;
78
import co.aikar.commands.annotation.Syntax;
89
import org.bukkit.command.CommandSender;
910
import tc.oc.occ.cheaty.DiscordBot;
1011
import tc.oc.occ.cheaty.DiscordBot.RelayType;
1112

13+
@CommandAlias("cheaty")
1214
public class BotCommands extends BaseCommand {
1315

1416
@Dependency private DiscordBot bot;
1517

16-
@CommandAlias("relay")
18+
@Subcommand("relay")
1719
@Syntax("[message] - Message to relay to discord")
1820
@CommandPermission("cheaty.bot")
1921
public void relay(CommandSender sender, String message) {

src/main/java/tc/oc/occ/cheaty/commands/CheatNotifyCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import co.aikar.commands.annotation.CommandAlias;
88
import co.aikar.commands.annotation.CommandPermission;
99
import co.aikar.commands.annotation.Dependency;
10+
import co.aikar.commands.annotation.Subcommand;
1011
import co.aikar.commands.annotation.Syntax;
1112
import net.kyori.adventure.text.Component;
1213
import net.kyori.adventure.text.TextComponent;
@@ -26,12 +27,13 @@
2627
import tc.oc.pgm.util.named.NameStyle;
2728
import tc.oc.pgm.util.text.TextTranslations;
2829

30+
@CommandAlias("cheaty")
2931
public class CheatNotifyCommand extends BaseCommand {
3032

3133
@Dependency private BotConfig config;
3234
@Dependency private DiscordBot bot;
3335

34-
@CommandAlias("cheaty notify")
36+
@Subcommand("notify")
3537
@Syntax("[player] [message]")
3638
@CommandPermission("cheaty.notify")
3739
public void notify(CommandSender sender, String target, String message) {

0 commit comments

Comments
 (0)