mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-01-03 13:38:20 +00:00
Fix NPE in help command (#1032)
## Fixes * Fixes NPE in help command by removing unnecessary side-plugin usage strings.
This commit is contained in:
parent
8e8f7a5130
commit
e0512d3f6c
2 changed files with 2 additions and 27 deletions
|
@ -35,9 +35,6 @@ public class HelpCommand extends PKCommand {
|
|||
private final String avatar;
|
||||
private final String invalidTopic;
|
||||
private final String usage;
|
||||
private final String rpgUsage;
|
||||
private final String spiritsUsage;
|
||||
private final String itemsUsage;
|
||||
|
||||
public HelpCommand() {
|
||||
super("help", "/bending help <Page/Topic>", ConfigManager.languageConfig.get().getString("Commands.Help.Description"), new String[] { "help", "h" });
|
||||
|
@ -54,9 +51,6 @@ public class HelpCommand extends PKCommand {
|
|||
this.avatar = ConfigManager.languageConfig.get().getString("Commands.Help.Elements.Avatar");
|
||||
this.invalidTopic = ConfigManager.languageConfig.get().getString("Commands.Help.InvalidTopic");
|
||||
this.usage = ConfigManager.languageConfig.get().getString("Commands.Help.Usage");
|
||||
this.rpgUsage = ConfigManager.languageConfig.get().getString("Command.Help.RPGUsage");
|
||||
this.spiritsUsage = ConfigManager.languageConfig.get().getString("Commands.Help.SpiritsUsage");
|
||||
this.itemsUsage = ConfigManager.languageConfig.get().getString("Commands.Help.ItemsUsage");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -72,15 +66,7 @@ public class HelpCommand extends PKCommand {
|
|||
strings.add(command.getProperUse());
|
||||
}
|
||||
}
|
||||
if (GeneralMethods.hasItems()) {
|
||||
strings.add(this.itemsUsage);
|
||||
}
|
||||
if (GeneralMethods.hasRPG()) {
|
||||
strings.add(this.rpgUsage);
|
||||
}
|
||||
if (GeneralMethods.hasSpirits()) {
|
||||
strings.add(this.spiritsUsage);
|
||||
}
|
||||
|
||||
Collections.sort(strings);
|
||||
Collections.reverse(strings);
|
||||
strings.add(instances.get("help").getProperUse());
|
||||
|
@ -104,15 +90,7 @@ public class HelpCommand extends PKCommand {
|
|||
for (final PKCommand command : instances.values()) {
|
||||
strings.add(command.getProperUse());
|
||||
}
|
||||
if (GeneralMethods.hasItems()) {
|
||||
strings.add(this.itemsUsage);
|
||||
}
|
||||
if (GeneralMethods.hasRPG()) {
|
||||
strings.add(this.rpgUsage);
|
||||
}
|
||||
if (GeneralMethods.hasSpirits()) {
|
||||
strings.add(this.spiritsUsage);
|
||||
}
|
||||
|
||||
for (final String s : this.getPage(strings, ChatColor.GOLD + "Commands: <" + this.required + "> [" + this.optional + "]", Integer.valueOf(arg), true)) {
|
||||
if (firstMessage) {
|
||||
GeneralMethods.sendBrandingMessage(sender, s);
|
||||
|
|
|
@ -166,9 +166,6 @@ public class ConfigManager {
|
|||
config.addDefault("Commands.Help.Elements.LearnMore", "Learn more at our website! ");
|
||||
config.addDefault("Commands.Help.InvalidTopic", "That isn't a valid help topic. Use /bending help for more information.");
|
||||
config.addDefault("Commands.Help.Usage", "Usage: ");
|
||||
config.addDefault("Commands.Help.RPGUsage", "/bending rpg [argument]");
|
||||
config.addDefault("Commands.Help.ItemsUsage", "/bending items [argument]");
|
||||
config.addDefault("Commands.Help.SpiritsUsage", "/bending spirits [argument]");
|
||||
|
||||
config.addDefault("Commands.Display.Description", "This command will show you all of the elements you have bound if you do not specify an element. If you do specify an element (Air, Water, Earth, Fire, or Chi), it will show you all of the available abilities of that element installed on the server.");
|
||||
|
||||
|
|
Loading…
Reference in a new issue