mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-11 10:58:51 +01:00
Prevent sending usage info when executing alternative commands (#3904)
This commit is contained in:
parent
026d279556
commit
eae8bc05c9
Essentials/src/main/java/com/earth2me/essentials
@ -92,7 +92,7 @@ public class AlternativeCommandsHandler {
|
|||||||
|
|
||||||
public void executed(final String label, final Command pc) {
|
public void executed(final String label, final Command pc) {
|
||||||
if (pc instanceof PluginIdentifiableCommand) {
|
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()) {
|
if (ess.getSettings().isDebug()) {
|
||||||
LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + altString);
|
LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + altString);
|
||||||
}
|
}
|
||||||
|
@ -581,12 +581,12 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||||||
if (pc != null) {
|
if (pc != null) {
|
||||||
alternativeCommandsHandler.executed(commandLabel, pc);
|
alternativeCommandsHandler.executed(commandLabel, pc);
|
||||||
try {
|
try {
|
||||||
return pc.execute(cSender, commandLabel, args);
|
pc.execute(cSender, commandLabel, args);
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||||
cSender.sendMessage(tl("internalError"));
|
cSender.sendMessage(tl("internalError"));
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user