mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-26 15:45:12 +01:00
Fixed registering already-existing permission
This commit is contained in:
parent
d2130e4d20
commit
f0c4e16635
@ -74,13 +74,15 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Regist
|
||||
if(!Prerequisite.areMet(prerequisites))
|
||||
return;
|
||||
|
||||
Permission permission = new Permission(
|
||||
"ecoenchants.fromtable." + permissionName,
|
||||
"Allows getting " + permissionName + " from an Enchanting Table",
|
||||
PermissionDefault.TRUE
|
||||
);
|
||||
permission.addParent(Bukkit.getPluginManager().getPermission("ecoenchants.fromtable.*"), true);
|
||||
Bukkit.getPluginManager().addPermission(permission);
|
||||
if(Bukkit.getPluginManager().getPermission("ecoenchants.fromtable." + permissionName) == null) {
|
||||
Permission permission = new Permission(
|
||||
"ecoenchants.fromtable." + permissionName,
|
||||
"Allows getting " + permissionName + " from an Enchanting Table",
|
||||
PermissionDefault.TRUE
|
||||
);
|
||||
permission.addParent(Bukkit.getPluginManager().getPermission("ecoenchants.fromtable.*"), true);
|
||||
Bukkit.getPluginManager().addPermission(permission);
|
||||
}
|
||||
|
||||
this.update();
|
||||
this.add();
|
||||
|
Loading…
Reference in New Issue
Block a user