summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-06-22 19:10:29 +0100
committerDinnerbone <dinnerbone@dinnerbone.com>2011-06-22 19:10:29 +0100
commit0a3b89c8f8a750dbae4f8580ae9b5931d087ad2f (patch)
treea0c44d8cecd9531cef69fe3c6df90c27b6edb0f8
parente73b10cf9ef8f3740072819066ee0e913be1d76f (diff)
downloadcraftbukkit-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.java14
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]));
}
}