mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Add per-command command cooldown bypass permissions (#4759)
Adds the permission `essentials.commandcooldowns.bypass.<command name>` to bypass the cooldown for a specific command. Closes #4747. Co-authored-by: pop4959 <pop4959@gmail.com> Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
This commit is contained in:
parent
17051eab73
commit
25ad8ac9bd
@ -662,7 +662,8 @@ public class EssentialsPlayerListener implements Listener, FakeAccessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ess.getSettings().isCommandCooldownsEnabled()
|
if (ess.getSettings().isCommandCooldownsEnabled()
|
||||||
&& !user.isAuthorized("essentials.commandcooldowns.bypass")) {
|
&& !user.isAuthorized("essentials.commandcooldowns.bypass")
|
||||||
|
&& (pluginCommand == null || !user.isAuthorized("essentials.commandcooldowns.bypass." + pluginCommand.getName()))) {
|
||||||
final int argStartIndex = effectiveCommand.indexOf(" ");
|
final int argStartIndex = effectiveCommand.indexOf(" ");
|
||||||
final String args = argStartIndex == -1 ? "" // No arguments present
|
final String args = argStartIndex == -1 ? "" // No arguments present
|
||||||
: " " + effectiveCommand.substring(argStartIndex); // arguments start at argStartIndex; substring from there.
|
: " " + effectiveCommand.substring(argStartIndex); // arguments start at argStartIndex; substring from there.
|
||||||
|
Loading…
Reference in New Issue
Block a user