diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-10 01:03:59 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-10 01:40:21 -0600 |
commit | dc93da8e34af96b793d9a4f4f43d4b9109bdb303 (patch) | |
tree | 64a5907d7ddb0c69e96236a2f3f6e073c91f8d82 | |
parent | f18b3cdc769e145c0823f4b43ff4f8271fdfb617 (diff) | |
download | craftbukkit-dc93da8e34af96b793d9a4f4f43d4b9109bdb303.tar craftbukkit-dc93da8e34af96b793d9a4f4f43d4b9109bdb303.tar.gz craftbukkit-dc93da8e34af96b793d9a4f4f43d4b9109bdb303.tar.lz craftbukkit-dc93da8e34af96b793d9a4f4f43d4b9109bdb303.tar.xz craftbukkit-dc93da8e34af96b793d9a4f4f43d4b9109bdb303.zip |
Pass null help values values as empty strings to HelpTopics
Fixes BUKKIT-2618 and BUKKIT-2561
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/help/HelpYamlReader.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/help/HelpYamlReader.java b/src/main/java/org/bukkit/craftbukkit/help/HelpYamlReader.java index bf1e67fa..60b8cbc8 100644 --- a/src/main/java/org/bukkit/craftbukkit/help/HelpYamlReader.java +++ b/src/main/java/org/bukkit/craftbukkit/help/HelpYamlReader.java @@ -23,7 +23,7 @@ public class HelpYamlReader { public HelpYamlReader(Server server) { this.server = server; - + File helpYamlFile = new File("help.yml"); YamlConfiguration defaultConfig = YamlConfiguration.loadConfiguration(getClass().getClassLoader().getResourceAsStream("configurations/help.yml")); @@ -56,9 +56,9 @@ public class HelpYamlReader { if (generalTopics != null) { for (String topicName : generalTopics.getKeys(false)) { ConfigurationSection section = generalTopics.getConfigurationSection(topicName); - String shortText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText")); - String fullText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("fullText")); - String permission = section.getString("permission"); + String shortText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText", "")); + String fullText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("fullText", "")); + String permission = section.getString("permission", ""); topics.add(new CustomHelpTopic(topicName, shortText, fullText, permission)); } } @@ -76,9 +76,9 @@ public class HelpYamlReader { if (indexTopics != null) { for (String topicName : indexTopics.getKeys(false)) { ConfigurationSection section = indexTopics.getConfigurationSection(topicName); - String shortText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText")); - String preamble = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("preamble")); - String permission = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("permission")); + String shortText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText", "")); + String preamble = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("preamble", "")); + String permission = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("permission", "")); List<String> commands = section.getStringList("commands"); topics.add(new CustomIndexHelpTopic(server.getHelpMap(), topicName, shortText, permission, commands, preamble)); } @@ -97,9 +97,9 @@ public class HelpYamlReader { if (commandTopics != null) { for (String topicName : commandTopics.getKeys(false)) { ConfigurationSection section = commandTopics.getConfigurationSection(topicName); - String description = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText")); - String usage = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("fullText")); - String permission = section.getString("permission"); + String description = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText", "")); + String usage = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("fullText", "")); + String permission = section.getString("permission", ""); amendments.add(new HelpTopicAmendment(topicName, description, usage, permission)); } } |