diff --git a/src/main/java/net/aufdemrand/denizen/objects/dPlayer.java b/src/main/java/net/aufdemrand/denizen/objects/dPlayer.java index a499604351..77cee4cc74 100644 --- a/src/main/java/net/aufdemrand/denizen/objects/dPlayer.java +++ b/src/main/java/net/aufdemrand/denizen/objects/dPlayer.java @@ -317,7 +317,8 @@ else if ((float) getPlayerEntity().getFoodLevel() / maxHunger < 1) return new Element(String.valueOf(getPlayerEntity().getFoodLevel())) .getAttribute(attribute.fulfill(1)); - if (attribute.startsWith("permission")) { + if (attribute.startsWith("permission") + || attribute.startsWith("has_permission")) { if (Depends.permissions == null) { dB.echoError("No permission system loaded! Have you installed Vault and a compatible permissions plugin?"); return null; @@ -326,7 +327,7 @@ else if ((float) getPlayerEntity().getFoodLevel() / maxHunger < 1) String permission = attribute.getContext(1); // Non-world specific permission - if (attribute.startsWith("permission.global")) + if (attribute.getAttribute(2).startsWith("global")) return new Element(String.valueOf(Depends.permissions.has((World) null, player_name, permission))) .getAttribute(attribute.fulfill(2)); @@ -346,7 +347,8 @@ else if ((float) getPlayerEntity().getFoodLevel() / maxHunger < 1) else return null; } - if (attribute.startsWith("group")) { + if (attribute.startsWith("group") + || attribute.startsWith("in_group")) { if (Depends.permissions == null) { dB.echoError("No permission system loaded! Have you installed Vault and a compatible permissions plugin?"); return "null"; @@ -355,7 +357,7 @@ else if ((float) getPlayerEntity().getFoodLevel() / maxHunger < 1) String group = attribute.getContext(1); // Non-world specific permission - if (attribute.startsWith("group.global")) + if (attribute.getAttribute(2).startsWith("global")) return new Element(String.valueOf(Depends.permissions.playerInGroup((World) null, player_name, group))) .getAttribute(attribute.fulfill(2)); @@ -398,7 +400,7 @@ else if ((float) getPlayerEntity().getFoodLevel() / maxHunger < 1) if (attribute.startsWith("selected_npc")) { if (getPlayerEntity().hasMetadata("selected")) - return dNPC.valueOf(String.valueOf(getPlayerEntity().getMetadata("selected").get(0))) + return dNPC.valueOf(getPlayerEntity().getMetadata("selected").get(0).asString()) .getAttribute(attribute.fulfill(1)); else return "null"; }