From 5b63ed08ed6df43b15d8fbfe3ab72f92cffe130b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 29 Oct 2016 22:11:33 +0200 Subject: [PATCH] Moved GetSubCommands() --- .../buttondevteam/chat/commands/CommandCaller.java | 14 -------------- .../chat/commands/ucmds/UCommand.java | 4 ++-- .../chat/commands/ucmds/admin/AdminCommand.java | 4 ++-- .../commands/ucmds/announce/AnnounceCommand.java | 4 ++-- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/main/java/buttondevteam/chat/commands/CommandCaller.java b/src/main/java/buttondevteam/chat/commands/CommandCaller.java index 72ba5fb..35dc981 100644 --- a/src/main/java/buttondevteam/chat/commands/CommandCaller.java +++ b/src/main/java/buttondevteam/chat/commands/CommandCaller.java @@ -72,18 +72,4 @@ public class CommandCaller implements CommandExecutor { } return true; } - - public static String[] GetSubCommands(TBMCCommandBase command) { - ArrayList cmds = new ArrayList(); - cmds.add("ยง6---- Subcommands ----"); - for (TBMCCommandBase cmd : TBMCChatAPI.GetCommands().values()) { - if (cmd.GetCommandPath().startsWith(command.GetCommandPath() + "/")) { - int ind = cmd.GetCommandPath().indexOf('/', command.GetCommandPath().length() + 2); - if (ind >= 0) - continue; - cmds.add(cmd.GetCommandPath().replace('/', ' ')); - } - } - return cmds.toArray(new String[cmds.size()]); - } } diff --git a/src/main/java/buttondevteam/chat/commands/ucmds/UCommand.java b/src/main/java/buttondevteam/chat/commands/ucmds/UCommand.java index b750efb..85b901d 100644 --- a/src/main/java/buttondevteam/chat/commands/ucmds/UCommand.java +++ b/src/main/java/buttondevteam/chat/commands/ucmds/UCommand.java @@ -2,14 +2,14 @@ package buttondevteam.chat.commands.ucmds; import org.bukkit.command.CommandSender; -import buttondevteam.chat.commands.CommandCaller; +import buttondevteam.lib.chat.TBMCChatAPI; import buttondevteam.lib.chat.TBMCCommandBase; public final class UCommand extends TBMCCommandBase { @Override public String[] GetHelpText(String alias) { - return CommandCaller.GetSubCommands(this); + return TBMCChatAPI.GetSubCommands(this); } @Override diff --git a/src/main/java/buttondevteam/chat/commands/ucmds/admin/AdminCommand.java b/src/main/java/buttondevteam/chat/commands/ucmds/admin/AdminCommand.java index c653c75..46f285c 100644 --- a/src/main/java/buttondevteam/chat/commands/ucmds/admin/AdminCommand.java +++ b/src/main/java/buttondevteam/chat/commands/ucmds/admin/AdminCommand.java @@ -2,14 +2,14 @@ package buttondevteam.chat.commands.ucmds.admin; import org.bukkit.command.CommandSender; -import buttondevteam.chat.commands.CommandCaller; import buttondevteam.chat.commands.ucmds.UCommandBase; +import buttondevteam.lib.chat.TBMCChatAPI; public final class AdminCommand extends UCommandBase { @Override public String[] GetHelpText(String alias) { - return CommandCaller.GetSubCommands(this); + return TBMCChatAPI.GetSubCommands(this); } @Override diff --git a/src/main/java/buttondevteam/chat/commands/ucmds/announce/AnnounceCommand.java b/src/main/java/buttondevteam/chat/commands/ucmds/announce/AnnounceCommand.java index 8bfc7ac..623c3c8 100644 --- a/src/main/java/buttondevteam/chat/commands/ucmds/announce/AnnounceCommand.java +++ b/src/main/java/buttondevteam/chat/commands/ucmds/announce/AnnounceCommand.java @@ -3,13 +3,13 @@ package buttondevteam.chat.commands.ucmds.announce; import org.bukkit.command.CommandSender; import buttondevteam.chat.commands.ucmds.UCommandBase; -import buttondevteam.chat.commands.CommandCaller; +import buttondevteam.lib.chat.TBMCChatAPI; public class AnnounceCommand extends UCommandBase { @Override public String[] GetHelpText(String alias) { - return CommandCaller.GetSubCommands(this); + return TBMCChatAPI.GetSubCommands(this); } @Override