Little refactoring...

This commit is contained in:
extendedclip
2018-03-23 17:03:56 -04:00
parent 68fb8e7e65
commit af68dbcf8b
5 changed files with 130 additions and 132 deletions

View File

@@ -53,46 +53,44 @@ public class PlaceholderAPICommands implements CommandExecutor {
public boolean onCommand(CommandSender s, Command c, String label, String[] args) {
if (args.length == 0) {
Msg.msg(s, "PlaceholderAPI &7version &b&o"+plugin.getDescription().getVersion());
Msg.msg(s, "&fCreated by&7: &bextended_clip");
Msg.msg(s, "PlaceholderAPI &7version &b&o" + plugin.getDescription().getVersion(),
"&fCreated by&7: &bextended_clip");
return true;
} else {
if (args[0].equalsIgnoreCase("help")) {
Msg.msg(s, "PlaceholderAPI &aHelp &e(&f" + plugin.getDescription().getVersion() + "&e)");
Msg.msg(s, "&b/papi");
Msg.msg(s, "&fView plugin info/version info");
Msg.msg(s, "&b/papi list");
Msg.msg(s, "&fList all placeholder expansions that are currently active");
Msg.msg(s, "&b/papi info <placeholder name>");
Msg.msg(s, "&fView information for a specific expansion");
Msg.msg(s, "&b/papi parse <...args>");
Msg.msg(s, "&fParse a String with placeholders");
Msg.msg(s, "&b/papi parserel <player one> <player two> <...args>");
Msg.msg(s, "&fParse a String with relational placeholders");
Msg.msg(s, "&b/papi reload");
Msg.msg(s, "&fReload the config settings");
boolean enabled = plugin.getExpansionCloud() != null;
Msg.msg(s, "PlaceholderAPI &aHelp &e(&f" + plugin.getDescription().getVersion() + "&e)",
"&b/papi",
"&fView plugin info/version info",
"&b/papi list",
"&fList all placeholder expansions that are currently active",
"&b/papi info <placeholder name>",
"&fView information for a specific expansion",
"&b/papi parse <...args>",
"&fParse a String with placeholders",
"&b/papi parserel <player one> <player two> <...args>",
"&fParse a String with relational placeholders",
"&b/papi reload",
"&fReload the config settings");
if (s.isOp()) {
if (!enabled) {
Msg.msg(s, "&b/papi enablecloud");
Msg.msg(s, "&fEnable the expansion cloud");
if (plugin.getExpansionCloud() == null) {
Msg.msg(s, "&b/papi enablecloud",
"&fEnable the expansion cloud");
} else {
Msg.msg(s, "&b/papi disablecloud");
Msg.msg(s, "&fDisable the expansion cloud");
Msg.msg(s, "&b/papi ecloud");
Msg.msg(s, "&fView information about the PlaceholderAPI expansion cloud");
Msg.msg(s, "&b/papi ecloud status");
Msg.msg(s, "&fView status of the PlaceholderAPI expansion cloud");
Msg.msg(s, "&b/papi ecloud list <all/author> <page>");
Msg.msg(s, "&fList all available expansions");
Msg.msg(s, "&b/papi ecloud info <expansion name>");
Msg.msg(s, "&fView information about a specific expansion on the cloud");
Msg.msg(s, "&b/papi ecloud download <expansion name>");
Msg.msg(s, "&fDownload a specific expansion from the cloud");
Msg.msg(s, "&b/papi disablecloud",
"&fDisable the expansion cloud",
"&b/papi ecloud",
"&fView information about the PlaceholderAPI expansion cloud",
"&b/papi ecloud status",
"&fView status of the PlaceholderAPI expansion cloud",
"&b/papi ecloud list <all/author> <page>",
"&fList all available expansions",
"&b/papi ecloud info <expansion name>",
"&fView information about a specific expansion on the cloud",
"&b/papi ecloud download <expansion name>",
"&fDownload a specific expansion from the cloud");
}
}
@@ -112,7 +110,6 @@ public class PlaceholderAPICommands implements CommandExecutor {
return eCloud.onCommand(s, c, label, args);
} else if (args[0].equalsIgnoreCase("enablecloud")) {
if (!s.isOp()) {
Msg.msg(s, "&cYou don't have permission to do that!");
return true;
@@ -182,7 +179,7 @@ public class PlaceholderAPICommands implements CommandExecutor {
if (ex.getPlugin() != null) {
Msg.msg(s, "&7Requires plugin: &f" + ex.getPlugin());
}
if (ex.getPlaceholders() != null) {
Msg.msg(s, "&8&m-- &r&7Placeholders &8&m--");
for (String placeholder : ex.getPlaceholders()) {
@@ -274,7 +271,7 @@ public class PlaceholderAPICommands implements CommandExecutor {
Msg.msg(s, "&cIncorrect usage! &7/papi help");
}
}
return true;
}