Return the Permission if it was created, or the old one if it existed.

This commit is contained in:
Eric Stokes 2011-08-24 18:49:13 -06:00
parent 69360a49ec
commit b6755a1047

View File

@ -181,12 +181,13 @@ public class MVPermissions implements PermissionsInterface {
return true;
}
public void addPermission(String string, PermissionDefault defaultValue) {
public Permission addPermission(String string, PermissionDefault defaultValue) {
if (this.plugin.getServer().getPluginManager().getPermission(string) == null) {
Permission permission = new Permission(string, defaultValue);
this.plugin.getServer().getPluginManager().addPermission(permission);
this.addToParentPerms(string);
}
return this.plugin.getServer().getPluginManager().getPermission(string);
}
private void addToParentPerms(String permString) {