mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-24 01:57:58 +01:00
Fix command cooldowns command matching.
This commit is contained in:
parent
00301b26e6
commit
03c652cd55
@ -421,9 +421,9 @@ public class EssentialsPlayerListener implements Listener {
|
|||||||
if (ess.getSettings().isCommandCooldownsEnabled() && pluginCommand != null
|
if (ess.getSettings().isCommandCooldownsEnabled() && pluginCommand != null
|
||||||
&& !user.isAuthorized("essentials.commandcooldowns.bypass")) {
|
&& !user.isAuthorized("essentials.commandcooldowns.bypass")) {
|
||||||
int argStartIndex = event.getMessage().indexOf(" ");
|
int argStartIndex = event.getMessage().indexOf(" ");
|
||||||
String args = argStartIndex == -1 ? event.getMessage() // No arguments present
|
String args = argStartIndex == -1 ? "" // No arguments present
|
||||||
: event.getMessage().substring(argStartIndex); // arguments start at argStartIndex; substring from there.
|
: " " + event.getMessage().substring(argStartIndex); // arguments start at argStartIndex; substring from there.
|
||||||
String fullCommand = pluginCommand.getName() + " " + args;
|
String fullCommand = pluginCommand.getName() + args;
|
||||||
|
|
||||||
// Used to determine whether a user already has an existing cooldown
|
// Used to determine whether a user already has an existing cooldown
|
||||||
// If so, no need to check for (and write) new ones.
|
// If so, no need to check for (and write) new ones.
|
||||||
|
Loading…
Reference in New Issue
Block a user