Commits

md_5 authored 68cb4c61970
Deprioritise Bukkit Commands
No tags

src/main/java/org/bukkit/command/SimpleCommandMap.java

Modified
88 88 *
89 89 * @param label the name of the command, without the '/'-prefix.
90 90 * @param command the command to register
91 91 * @param isAlias whether the command is an alias
92 92 * @param fallbackPrefix a prefix which is prepended to the command for a
93 93 * unique address
94 94 * @return true if command was registered, false otherwise.
95 95 */
96 96 private synchronized boolean register(String label, Command command, boolean isAlias, String fallbackPrefix) {
97 97 knownCommands.put(fallbackPrefix + ":" + label, command);
98 - if (isAlias && knownCommands.containsKey(label)) {
98 + if ((command instanceof BukkitCommand || isAlias) && knownCommands.containsKey(label)) {
99 99 // Request is for an alias/fallback command and it conflicts with
100 100 // a existing command or previous alias ignore it
101 101 // Note: This will mean it gets removed from the commands list of active aliases
102 102 return false;
103 103 }
104 104
105 105 boolean registered = true;
106 106
107 107 // If the command exists but is an alias we overwrite it, otherwise we return
108 108 Command conflict = knownCommands.get(label);

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut