From d3b62214a64c695b1b8cc617ec2480e09ed4b336 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 16 Feb 2011 21:45:15 -0800 Subject: [PATCH] Fixed alias parsing for commands. object.toString().split(",") is NOT how you parse a YAML list! By: sk89q --- .../org/bukkit/command/PluginCommandYamlParser.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/command/PluginCommandYamlParser.java b/paper-api/src/main/java/org/bukkit/command/PluginCommandYamlParser.java index 9b4f8493b2..2305e0ed7c 100644 --- a/paper-api/src/main/java/org/bukkit/command/PluginCommandYamlParser.java +++ b/paper-api/src/main/java/org/bukkit/command/PluginCommandYamlParser.java @@ -9,13 +9,13 @@ import org.bukkit.plugin.Plugin; public class PluginCommandYamlParser { + @SuppressWarnings("unchecked") public static List parse(Plugin plugin) { List pluginCmds = new ArrayList(); Object object = plugin.getDescription().getCommands(); if (object == null) return pluginCmds; - @SuppressWarnings("unchecked") Map> map = (Map>)object; if (map != null) { @@ -34,9 +34,13 @@ public class PluginCommandYamlParser { if (aliases != null) { List aliasList = new ArrayList(); - - for(String a : aliases.toString().split(",")) { - aliasList.add(a); + + if (aliases instanceof List) { + for (Object o : (List)aliases) { + aliasList.add(o.toString()); + } + } else { + aliasList.add(aliases.toString()); } newCmd.setAliases(aliasList);