Prevent sending usage info when executing alternative commands (#3904)

This commit is contained in:
triagonal 2021-01-10 05:47:58 +11:00 committed by GitHub
parent 026d279556
commit eae8bc05c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ public class AlternativeCommandsHandler {
public void executed(final String label, final Command pc) {
if (pc instanceof PluginIdentifiableCommand) {
final String altString = ((PluginIdentifiableCommand) pc).getPlugin().getName() + ":" + pc.getLabel();
final String altString = ((PluginIdentifiableCommand) pc).getPlugin().getName() + ":" + pc.getName();
if (ess.getSettings().isDebug()) {
LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + altString);
}

View File

@ -581,12 +581,12 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
if (pc != null) {
alternativeCommandsHandler.executed(commandLabel, pc);
try {
return pc.execute(cSender, commandLabel, args);
pc.execute(cSender, commandLabel, args);
} catch (final Exception ex) {
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
cSender.sendMessage(tl("internalError"));
return true;
}
return true;
}
}