Commits

t00thpick1 authored and EvilSeph committed 71a5f8b8350
[Bleeding] Plugin aliases should have higher priority than fallbacks.

Fixes BUKKIT-5442
No tags

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

Modified
124 124 }
125 125
126 126 /**
127 127 * Registers a command with the given name is possible.
128 128 *
129 129 * @param label the name of the command, without the '/'-prefix.
130 130 * @param command the command to register
131 131 * @return true if command was registered, false otherwise.
132 132 */
133 133 private synchronized boolean register(String label, Command command, boolean isAlias) {
134 - if (isAlias && knownCommands.containsKey(label)) {
135 - // Request is for an alias and it conflicts with a existing command or previous alias ignore it
134 + if ((command instanceof VanillaCommand || isAlias) && knownCommands.containsKey(label)) {
135 + // Request is for an alias/fallback command and it conflicts with
136 + // a existing command or previous alias ignore it
136 137 // Note: This will mean it gets removed from the commands list of active aliases
137 138 return false;
138 139 }
139 140
140 141 boolean registered = true;
141 142
142 143 // If the command exists but is an alias we overwrite it, otherwise we return
143 144 Command conflict = knownCommands.get(label);
144 145 if (conflict != null && conflict.getLabel().equals(label)) {
145 146 return false;

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

Add shortcut