Fix command cooldowns command matching.

This commit is contained in:
Ali Moghnieh 2016-08-07 15:58:34 +01:00
parent 00301b26e6
commit 03c652cd55
No known key found for this signature in database
GPG Key ID: F09D3A1BAF2E6D70

View File

@ -421,9 +421,9 @@ public class EssentialsPlayerListener implements Listener {
if (ess.getSettings().isCommandCooldownsEnabled() && pluginCommand != null
&& !user.isAuthorized("essentials.commandcooldowns.bypass")) {
int argStartIndex = event.getMessage().indexOf(" ");
String args = argStartIndex == -1 ? event.getMessage() // No arguments present
: event.getMessage().substring(argStartIndex); // arguments start at argStartIndex; substring from there.
String fullCommand = pluginCommand.getName() + " " + args;
String args = argStartIndex == -1 ? "" // No arguments present
: " " + event.getMessage().substring(argStartIndex); // arguments start at argStartIndex; substring from there.
String fullCommand = pluginCommand.getName() + args;
// Used to determine whether a user already has an existing cooldown
// If so, no need to check for (and write) new ones.