Added custom permissions and messages
This commit is contained in:
parent
b82cceb7dc
commit
61d8f8f6fd
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>cz.boosik</groupId>
|
||||
<artifactId>boosCooldowns</artifactId>
|
||||
<version>3.9.6a</version>
|
||||
<version>3.9.7</version>
|
||||
<name>boosCooldowns</name>
|
||||
<packaging>jar</packaging>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
|
|
@ -25,6 +25,10 @@ class BoosCoolDownListener implements Listener {
|
|||
int warmupTime, int cooldownTime, double price, String item,
|
||||
int count, int limit, int xpPrice) {
|
||||
boolean blocked = false;
|
||||
if (!player.hasPermission(BoosConfigManager.getPermission(player, regexCommad))){
|
||||
boosChat.sendMessageToPlayer(player, BoosConfigManager.getPermissionMessage(player, regexCommad));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
if (limit != -1) {
|
||||
blocked = BoosLimitManager.blocked(player, regexCommad,
|
||||
originalCommand, limit);
|
||||
|
|
|
@ -654,4 +654,16 @@ public class BoosConfigManager {
|
|||
return conf.getString("options.messages.limit_reset_now",
|
||||
"&6Reseting limits for command&e &command& &6now.&f");
|
||||
}
|
||||
|
||||
public static String getPermission(Player player, String regexCommad) {
|
||||
String group = getCommandGroup(player);
|
||||
return conf.getString("commands.groups." + group + "."
|
||||
+ regexCommad + ".permission");
|
||||
}
|
||||
|
||||
public static String getPermissionMessage(Player player, String regexCommad) {
|
||||
String group = getCommandGroup(player);
|
||||
return conf.getString("commands.groups." + group + "."
|
||||
+ regexCommad + ".denied_message");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,9 @@ options:
|
|||
commands:
|
||||
groups:
|
||||
default:
|
||||
/permissionstest:
|
||||
permission: "nice.permission"
|
||||
denied_message: You lack required permissions to use this command!
|
||||
/day_command:
|
||||
limit: 5
|
||||
shared_limit:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: boosCooldowns
|
||||
main: cz.boosik.boosCooldown.BoosCoolDown
|
||||
version: 3.9.6a
|
||||
version: 3.9.7
|
||||
authors: [LordBoos (boosik)]
|
||||
softdepend: [Vault]
|
||||
description: >
|
||||
|
|
Loading…
Reference in New Issue