mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 21:17:00 +01:00
Pass null help values values as empty strings to HelpTopics
Fixes BUKKIT-2618 and BUKKIT-2561
This commit is contained in:
parent
f18b3cdc76
commit
dc93da8e34
1 changed files with 10 additions and 10 deletions
|
@ -56,9 +56,9 @@ public class HelpYamlReader {
|
||||||
if (generalTopics != null) {
|
if (generalTopics != null) {
|
||||||
for (String topicName : generalTopics.getKeys(false)) {
|
for (String topicName : generalTopics.getKeys(false)) {
|
||||||
ConfigurationSection section = generalTopics.getConfigurationSection(topicName);
|
ConfigurationSection section = generalTopics.getConfigurationSection(topicName);
|
||||||
String shortText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText"));
|
String shortText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText", ""));
|
||||||
String fullText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("fullText"));
|
String fullText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("fullText", ""));
|
||||||
String permission = section.getString("permission");
|
String permission = section.getString("permission", "");
|
||||||
topics.add(new CustomHelpTopic(topicName, shortText, fullText, permission));
|
topics.add(new CustomHelpTopic(topicName, shortText, fullText, permission));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,9 +76,9 @@ public class HelpYamlReader {
|
||||||
if (indexTopics != null) {
|
if (indexTopics != null) {
|
||||||
for (String topicName : indexTopics.getKeys(false)) {
|
for (String topicName : indexTopics.getKeys(false)) {
|
||||||
ConfigurationSection section = indexTopics.getConfigurationSection(topicName);
|
ConfigurationSection section = indexTopics.getConfigurationSection(topicName);
|
||||||
String shortText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText"));
|
String shortText = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText", ""));
|
||||||
String preamble = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("preamble"));
|
String preamble = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("preamble", ""));
|
||||||
String permission = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("permission"));
|
String permission = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("permission", ""));
|
||||||
List<String> commands = section.getStringList("commands");
|
List<String> commands = section.getStringList("commands");
|
||||||
topics.add(new CustomIndexHelpTopic(server.getHelpMap(), topicName, shortText, permission, commands, preamble));
|
topics.add(new CustomIndexHelpTopic(server.getHelpMap(), topicName, shortText, permission, commands, preamble));
|
||||||
}
|
}
|
||||||
|
@ -97,9 +97,9 @@ public class HelpYamlReader {
|
||||||
if (commandTopics != null) {
|
if (commandTopics != null) {
|
||||||
for (String topicName : commandTopics.getKeys(false)) {
|
for (String topicName : commandTopics.getKeys(false)) {
|
||||||
ConfigurationSection section = commandTopics.getConfigurationSection(topicName);
|
ConfigurationSection section = commandTopics.getConfigurationSection(topicName);
|
||||||
String description = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText"));
|
String description = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("shortText", ""));
|
||||||
String usage = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("fullText"));
|
String usage = ChatColor.translateAlternateColorCodes(ALT_COLOR_CODE, section.getString("fullText", ""));
|
||||||
String permission = section.getString("permission");
|
String permission = section.getString("permission", "");
|
||||||
amendments.add(new HelpTopicAmendment(topicName, description, usage, permission));
|
amendments.add(new HelpTopicAmendment(topicName, description, usage, permission));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue