/** * Sets the label of this command. * <p> * If the command is currently registered the label change will only take * effect after its been re-registered e.g. after a /reload * * @param name The command's name * @return returns true if the name change happened instantly or false if * it was scheduled for re-registration */ public boolean setLabel(String name) { this.nextLabel = name; if (!isRegistered()) { this.label = name; return true; } return false; }
/** * Sets the list of aliases to request on registration for this command. * This is not effective outside of defining aliases in the {@link * PluginDescriptionFile#getCommands()} (under the * `<code>aliases</code>' node) is equivalent to this method. * * @param aliases aliases to register to this command * @return this command object, for chaining */ public Command setAliases(List<String> aliases) { this.aliases = aliases; if (!isRegistered()) { this.activeAliases = new ArrayList<String>(aliases); } return this; }
public boolean canSee(CommandSender sender) { if (!command.isRegistered() && !(command instanceof VanillaCommand)) { // Unregistered commands should not show up in the help (ignore VanillaCommands) return false; } if (sender instanceof ConsoleCommandSender) { return true; } if (amendedPermission != null) { return sender.hasPermission(amendedPermission); } else { return command.testPermissionSilent(sender); } } }
@Override public boolean isRegistered() { return cmd.isRegistered(); }
/** * Sets the list of aliases to request on registration for this command. * This is not effective outside of defining aliases in the {@link * PluginDescriptionFile#getCommands()} (under the * `<code>aliases</code>' node) is equivalent to this method. * * @param aliases aliases to register to this command * @return this command object, for chaining */ public Command setAliases(List<String> aliases) { this.aliases = aliases; if (!isRegistered()) { this.activeAliases = new ArrayList<String>(aliases); } return this; }
/** * Sets the label of this command. * <p> * If the command is currently registered the label change will only take * effect after its been re-registered e.g. after a /reload * * @param name The command's name * @return returns true if the name change happened instantly or false if * it was scheduled for re-registration */ public boolean setLabel(String name) { this.nextLabel = name; if (!isRegistered()) { this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot this.label = name; return true; } return false; }
public boolean canSee(CommandSender sender) { if (!command.isRegistered() && !(command instanceof VanillaCommand)) { // Unregistered commands should not show up in the help (ignore VanillaCommands) return false; } if (sender instanceof ConsoleCommandSender) { return true; } if (amendedPermission != null) { return sender.hasPermission(amendedPermission); } else { return command.testPermissionSilent(sender); } } }