diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-06-22 19:10:29 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-06-22 19:10:29 +0100 |
commit | 0a3b89c8f8a750dbae4f8580ae9b5931d087ad2f (patch) | |
tree | a0c44d8cecd9531cef69fe3c6df90c27b6edb0f8 | |
parent | e73b10cf9ef8f3740072819066ee0e913be1d76f (diff) | |
download | craftbukkit-0a3b89c8f8a750dbae4f8580ae9b5931d087ad2f.tar craftbukkit-0a3b89c8f8a750dbae4f8580ae9b5931d087ad2f.tar.gz craftbukkit-0a3b89c8f8a750dbae4f8580ae9b5931d087ad2f.tar.lz craftbukkit-0a3b89c8f8a750dbae4f8580ae9b5931d087ad2f.tar.xz craftbukkit-0a3b89c8f8a750dbae4f8580ae9b5931d087ad2f.zip |
Implemented new alias system
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 86f7cf55..212ba7db 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -551,13 +551,21 @@ public final class CraftServer implements Server { return true; } - public Map<String, String> getCommandAliases() { + public Map<String, String[]> getCommandAliases() { ConfigurationNode node = configuration.getNode("aliases"); - Map<String, String> result = new HashMap<String, String>(); + Map<String, String[]> result = new HashMap<String, String[]>(); if (node != null) { for (String key : node.getKeys()) { - result.put(key, node.getString(key)); + List<String> commands = new ArrayList<String>(); + + if (node.getProperty(key) instanceof List) { + commands = node.getStringList(key, null); + } else { + commands.add(node.getString(key)); + } + + result.put(key, commands.toArray(new String[0])); } } |