Server administrators can now specify custom aliases in bukkit.yml which override any aliases set by plugins.

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2011-06-17 04:07:17 +01:00
parent dc11d556ba
commit b02e6095bd
3 changed files with 33 additions and 0 deletions

View File

@@ -150,6 +150,22 @@ public final class SimpleCommandMap implements CommandMap {
return knownCommands.get(name.toLowerCase());
}
public void registerServerAliases() {
Map<String, String> values = server.getCommandAliases();
for (String alias : values.keySet()) {
String target = values.get(alias);
Command command = getCommand(target);
if (command != null) {
// We register these as commands so they have absolute priority.
knownCommands.put(alias.toLowerCase(), command);
} else {
server.getLogger().warning("Could not register custom alias '" + alias + "' to command '" + target + "' because the command does not exist.");
}
}
}
private static class VersionCommand extends Command {
private final Server server;