/** * {@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 boolean register(MCCommandMap map) { return cmd.register(((BukkitMCCommandMap) map).scm); }
/** * {@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; }
oldCommand.unregister(commandMap); oldCommand.setLabel(split[0] + ":" + command.getName()); oldCommand.register(commandMap);