/** * Checks if the label given is a possible label of the command. * * @param command The command to check against. * @param label The label that should be checked if it's a label for the * command. * @return {@code true} if the label is a label of the command, {@code false} if * it's not. */ private boolean isLabelOfCommand(PluginCommand command, String label) { assertMainThread(); if (label.equals(command.getName())) { return true; } for (String alias : command.getAliases()) { if (label.equals(alias)) { return true; } } return false; }
equivalentCommands.add(pluginCommand.getName().toLowerCase() + commandParameters); for (String alias : pluginCommand.getAliases()) { equivalentCommands.add(alias.toLowerCase() + commandParameters);
TabooLib.debug("Registered " + (methods.size() + fields.size()) + " sub-command with " + baseMainCommand.getRegisterCommand().getName() + " (" + baseMainCommand.getRegisterCommand().getPlugin().getName() + ")");
@Test public void getCommands_Default_PluginCommand() { Collection<PluginCommand> commands = pluginManager.getCommands(); assertEquals(3, commands.size()); Iterator<PluginCommand> iterator = commands.iterator(); assertEquals("mockcommand", iterator.next().getName()); assertEquals("testcommand", iterator.next().getName()); assertEquals("othercommand", iterator.next().getName()); assertFalse(iterator.hasNext()); }
FLog.warning("[Command] " + pluginCommand.getName() + " - permission is set to a console rank, " + "should be set to player variant with 'source = SourceType.ONLY_CONSOLE'");