mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 11:37:41 +01:00
Remove "/" at the CommandInfo
This commit is contained in:
parent
bcd008cbbe
commit
82cf6e62fd
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user