diff options
author | t00thpick1 <t00thpick1dirko@gmail.com> | 2014-02-18 21:47:03 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2014-03-22 16:42:39 -0400 |
commit | 71a5f8b83508e8d74323001285f9ab799423f8c8 (patch) | |
tree | a9cf12f4b859ea353ad8f8dded4f5c652ce6b3cd /src | |
parent | 9ae1dd5737de3a8b6d9044f05943ad5eebd2a8b8 (diff) | |
download | bukkit-71a5f8b83508e8d74323001285f9ab799423f8c8.tar bukkit-71a5f8b83508e8d74323001285f9ab799423f8c8.tar.gz bukkit-71a5f8b83508e8d74323001285f9ab799423f8c8.tar.lz bukkit-71a5f8b83508e8d74323001285f9ab799423f8c8.tar.xz bukkit-71a5f8b83508e8d74323001285f9ab799423f8c8.zip |
[Bleeding] Plugin aliases should have higher priority than fallbacks. Fixes BUKKIT-5442
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/command/SimpleCommandMap.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java index 4bf79988..8681987f 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -131,8 +131,9 @@ public class SimpleCommandMap implements CommandMap { * @return true if command was registered, false otherwise. */ private synchronized boolean register(String label, Command command, boolean isAlias) { - if (isAlias && knownCommands.containsKey(label)) { - // Request is for an alias and it conflicts with a existing command or previous alias ignore it + if ((command instanceof VanillaCommand || isAlias) && knownCommands.containsKey(label)) { + // Request is for an alias/fallback command and it conflicts with + // a existing command or previous alias ignore it // Note: This will mean it gets removed from the commands list of active aliases return false; } |