From 8c829417a77bf033c9de0fb9c99ab4e62a8876d0 Mon Sep 17 00:00:00 2001 From: extendedclip Date: Fri, 31 Jul 2020 10:37:47 -0400 Subject: [PATCH] Added missing commands to help commands, fixed some color / formatting --- .../commands/impl/cloud/CommandECloud.java | 4 ++++ .../impl/cloud/CommandECloudDownload.java | 11 +++++----- .../cloud/CommandECloudExpansionInfo.java | 2 +- .../cloud/CommandECloudExpansionList.java | 2 +- .../CommandECloudExpansionPlaceholders.java | 2 +- .../commands/impl/local/CommandDump.java | 20 +++++++++++++++++++ .../commands/impl/local/CommandHelp.java | 6 ++++-- .../commands/impl/local/CommandList.java | 6 +++--- .../commands/impl/local/CommandParse.java | 4 ++-- 9 files changed, 42 insertions(+), 15 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloud.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloud.java index aa428ce..347f9ba 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloud.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloud.java @@ -81,6 +81,8 @@ public final class CommandECloud extends PlaceholderCommand Msg.msg(sender, "&b&lPlaceholderAPI &8- &7eCloud Help Menu &8- ", " ", + "&b/papi &fenable/disable/toggle", + " &7&oEnable or disable the eCloud", "&b/papi &fecloud status", " &7&oView status of the eCloud", "&b/papi &fecloud list {page}", @@ -91,6 +93,8 @@ public final class CommandECloud extends PlaceholderCommand " &7&oView placeholders for an expansion", "&b/papi &fecloud download {version}", " &7&oDownload an expansion from the eCloud", + "&b/papi &fecloud update ", + " &7&oUpdate a specific/all installed expansions", "&b/papi &fecloud refresh", " &7&oFetch the most up to date list of expansions available.", "&b/papi &fecloud clear", diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java index cd54845..16d002c 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java @@ -46,7 +46,7 @@ public final class CommandECloudDownload extends PlaceholderCommand if (params.isEmpty()) { Msg.msg(sender, - "&cYou must supply the name of an eCloud expansion."); + "&cYou must supply the name of an expansion."); return; } @@ -54,7 +54,7 @@ public final class CommandECloudDownload extends PlaceholderCommand if (expansion == null) { Msg.msg(sender, - "&cCould not find expansion named: &f" + params.get(0)); + "&cFailed to find an expansion named: &f" + params.get(0)); return; } @@ -76,7 +76,7 @@ public final class CommandECloudDownload extends PlaceholderCommand { Msg.msg(sender, "&cCould not find specified version: &f" + params.get(1), - "&7Versions: &a" + expansion.getAvailableVersions()); + "&7Available versions: &f" + expansion.getAvailableVersions()); return; } } @@ -85,12 +85,13 @@ public final class CommandECloudDownload extends PlaceholderCommand if (exception != null) { Msg.msg(sender, - "&cFailed to download expansion: &e" + exception.getMessage()); + "&cFailed to download expansion: &f" + exception.getMessage()); return; } Msg.msg(sender, - "&aSuccessfully downloaded expansion to file: &e" + file.getName()); + "&aSuccessfully downloaded expansion &f" + expansion.getName() + " [" + version + "] &ato file: &f" + file.getName(), + "&aMake sure to type &f/papi reload &ato enable your new expansion!"); plugin.getCloudExpansionManager().clean(); plugin.getCloudExpansionManager().fetch(plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions()); diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionInfo.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionInfo.java index a57ca00..1d21d4e 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionInfo.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionInfo.java @@ -91,7 +91,7 @@ public final class CommandECloudExpansionInfo extends PlaceholderCommand { Msg.msg(sender, "&cCould not find specified version: &f" + params.get(1), - "&7Versions: &a" + expansion.getAvailableVersions()); + "&aVersions: &f" + expansion.getAvailableVersions()); return; } diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionList.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionList.java index 3244cb6..6dd392d 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionList.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionList.java @@ -30,9 +30,9 @@ import me.clip.placeholderapi.commands.PlaceholderCommand; import me.clip.placeholderapi.configuration.ExpansionSort; import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.expansion.cloud.CloudExpansion; +import me.clip.placeholderapi.libs.JSONMessage; import me.clip.placeholderapi.util.Format; import me.clip.placeholderapi.util.Msg; -import me.rayzr522.jsonmessage.JSONMessage; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionPlaceholders.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionPlaceholders.java index cdb78d7..e4177b0 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionPlaceholders.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionPlaceholders.java @@ -63,7 +63,7 @@ public final class CommandECloudExpansionPlaceholders extends PlaceholderCommand if (placeholders == null || placeholders.isEmpty()) { Msg.msg(sender, - "&cThat expansion does not have placeholders listed."); + "&cThe expansion specified does not have placeholders listed."); return; } diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandDump.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandDump.java index d66a160..9f14b1a 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandDump.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandDump.java @@ -1,3 +1,23 @@ +/* + * This file is part of PlaceholderAPI + * + * PlaceholderAPI + * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * + * PlaceholderAPI free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlaceholderAPI is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package me.clip.placeholderapi.commands.impl.local; import com.google.common.io.CharStreams; diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandHelp.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandHelp.java index 8486f2f..c1a56de 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandHelp.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandHelp.java @@ -47,7 +47,7 @@ public final class CommandHelp extends PlaceholderCommand Msg.msg(sender, "&b&lPlaceholderAPI &8- &7Help Menu &8- &7(&f" + description.getVersion() + "&7)", " ", - "&b/papi", + "&b/papi &fversion", " &7&oView plugin info/version", "&b/papi &freload", " &7&oReload the config of PAPI", @@ -61,12 +61,14 @@ public final class CommandHelp extends PlaceholderCommand " &7&oParse a message with placeholders and broadcast it", "&b/papi &fparserel &9 ", " &7&oParse a message with relational placeholders", + "&b/papi &fcmdparse &9 ", + " &7&oParse a message with relational placeholders", "&b/papi &fregister &9", " &7&oRegister an expansion by the name of the file", "&b/papi &funregister &9", " &7&oUnregister an expansion by name", "&b/papi &fdump", - " &7&oTake a dump and send it to Sxtanna or someone else in HelpChat"); + " &7&oDump all relevant information needed to help debug issues into a paste link."); } } diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandList.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandList.java index 864d4e3..a2f7bc3 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandList.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandList.java @@ -48,15 +48,15 @@ public final class CommandList extends PlaceholderCommand final Set identifiers = PlaceholderAPI.getRegisteredIdentifiers(); if (identifiers.isEmpty()) { - Msg.msg(sender, "&6There are no placeholder hooks active!"); + Msg.msg(sender, "&cThere are no placeholder hooks active!"); return; } final List> partitions = Lists.partition(identifiers.stream().sorted().collect(Collectors.toList()), 10); Msg.msg(sender, - "&6" + identifiers.size() + "&7 placeholder hook(s) active: &a", - partitions.stream().map(partition -> " " + String.join(", ", partition)).collect(Collectors.joining("\n"))); + "&7A total of &f" + identifiers.size() + "&7 placeholder hook(s) are active: &a", + partitions.stream().map(partition -> String.join("&7, &a", partition)).collect(Collectors.joining("\n"))); } } diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java index e0298fe..2c769df 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java @@ -155,14 +155,14 @@ public final class CommandParse extends PlaceholderCommand final OfflinePlayer targetOne = resolvePlayer(params.get(0)); if (targetOne == null || !targetOne.isOnline()) { - Msg.msg(sender, "&cFailed to find player: &7" + params.get(0)); + Msg.msg(sender, "&cFailed to find player: &f" + params.get(0)); return; } final OfflinePlayer targetTwo = resolvePlayer(params.get(1)); if (targetTwo == null || !targetTwo.isOnline()) { - Msg.msg(sender, "&cFailed to find player: &7" + params.get(1)); + Msg.msg(sender, "&cFailed to find player: &f" + params.get(1)); return; }