Remove "/" at the CommandInfo

This commit is contained in:
Fuzzlemann 2017-08-18 18:00:39 +02:00
parent bcd008cbbe
commit 82cf6e62fd

View File

@ -43,20 +43,20 @@ public class PlanCommandPreprocessListener implements Listener {
return;
}
String commandName = event.getMessage().split(" ")[0].toLowerCase();
String commandName = event.getMessage().substring(1).split(" ")[0].toLowerCase();
boolean doNotLogUnknownCommands = Settings.DO_NOT_LOG_UNKNOWN_COMMANDS.isTrue();
boolean combineCommandAliasesToMainCommand = Settings.COMBINE_COMMAND_ALIASES_TO_MAIN_COMMAND.isTrue();
if (doNotLogUnknownCommands || combineCommandAliasesToMainCommand) {
Command command = plugin.getServer().getPluginCommand(commandName.substring(1, commandName.length()));
Command command = plugin.getServer().getPluginCommand(commandName);
if (command == null) {
if (doNotLogUnknownCommands) {
Log.debug("Ignored command, command is unknown");
return;
}
} else if (combineCommandAliasesToMainCommand) {
commandName = "/" + command.getName();
commandName = command.getName();
}
}