From 0a3b89c8f8a750dbae4f8580ae9b5931d087ad2f Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Wed, 22 Jun 2011 19:10:29 +0100 Subject: Implemented new alias system --- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 14 +++++++++++--- 1 file 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 getCommandAliases() { + public Map getCommandAliases() { ConfigurationNode node = configuration.getNode("aliases"); - Map result = new HashMap(); + Map result = new HashMap(); if (node != null) { for (String key : node.getKeys()) { - result.put(key, node.getString(key)); + List commands = new ArrayList(); + + 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])); } } -- cgit v1.2.3