Whitespace + general cleanup

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot
2011-05-14 23:22:54 +02:00
parent 8217ff1836
commit 855f4133b6
216 changed files with 1649 additions and 1637 deletions

View File

@@ -13,20 +13,23 @@ public class PluginCommandYamlParser {
public static List<Command> parse(Plugin plugin) {
List<Command> pluginCmds = new ArrayList<Command>();
Object object = plugin.getDescription().getCommands();
if (object == null)
return pluginCmds;
Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>)object;
if (object == null) {
return pluginCmds;
}
Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>) object;
if (map != null) {
for(Entry<String, Map<String, Object>> entry : map.entrySet()) {
Command newCmd = new PluginCommand(entry.getKey(),plugin);
for (Entry<String, Map<String, Object>> entry : map.entrySet()) {
Command newCmd = new PluginCommand(entry.getKey(), plugin);
Object description = entry.getValue().get("description");
Object usage = entry.getValue().get("usage");
Object aliases = entry.getValue().get("aliases");
if (description != null)
if (description != null) {
newCmd.setDescription(description.toString());
}
if (usage != null) {
newCmd.setUsage(usage.toString());
@@ -34,9 +37,9 @@ public class PluginCommandYamlParser {
if (aliases != null) {
List<String> aliasList = new ArrayList<String>();
if (aliases instanceof List) {
for (Object o : (List<Object>)aliases) {
for (Object o : (List<Object>) aliases) {
aliasList.add(o.toString());
}
} else {
@@ -51,5 +54,4 @@ public class PluginCommandYamlParser {
}
return pluginCmds;
}
}