command.setLabel(label);
/** * {@inheritDoc} */ public boolean register(String label, String fallbackPrefix, Command command) { label = label.toLowerCase().trim(); fallbackPrefix = fallbackPrefix.toLowerCase().trim(); boolean registered = register(label, command, false, fallbackPrefix); Iterator<String> iterator = command.getAliases().iterator(); while (iterator.hasNext()) { if (!register(iterator.next(), command, true, fallbackPrefix)) { iterator.remove(); } } // If we failed to register under the real name, we need to set the command label to the direct address if (!registered) { command.setLabel(fallbackPrefix + ":" + label); } // Register to us so further updates of the commands label and aliases are postponed until its reregistered command.register(this); return registered; }
@Override public MCCommand setLabel(String name) { cmd.setLabel(name); return this; }
command.setLabel(label);
/** * {@inheritDoc} */ public boolean register(String label, String fallbackPrefix, Command command) { label = label.toLowerCase().trim(); fallbackPrefix = fallbackPrefix.toLowerCase().trim(); boolean registered = register(label, command, false, fallbackPrefix); Iterator<String> iterator = command.getAliases().iterator(); while (iterator.hasNext()) { if (!register(iterator.next(), command, true, fallbackPrefix)) { iterator.remove(); } } // If we failed to register under the real name, we need to set the command label to the direct address if (!registered) { command.setLabel(fallbackPrefix + ":" + label); } // Register to us so further updates of the commands label and aliases are postponed until its reregistered command.register(this); return registered; }
if (split.length > 1) { oldCommand.unregister(commandMap); oldCommand.setLabel(split[0] + ":" + command.getName()); oldCommand.register(commandMap);
public void restore() { // (Don't skip resetting, as there could be fall-back aliases.) // Command registered = CommandUtil.getCommand(label); // if (registered == null || registered != command) return; if (!label.equalsIgnoreCase(command.getLabel().trim().toLowerCase())) { command.setLabel(label); } command.setPermission(permission); if (permission != null && permissionDefault != null) { Permission perm = Bukkit.getPluginManager().getPermission(permission); if (perm != null && perm.getDefault() != permissionDefault) { perm.setDefault(permissionDefault); } } command.setPermissionMessage(permissionMessage); } }