From ddb1d7be789bef7b6c25a7c19caac6da661e71ef Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 24 Aug 2012 01:56:45 +0200 Subject: [PATCH 1/2] Update src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java Implement missing has(Player player, String permission) method to the bPermissions API --- .../vault/permission/plugins/Permission_bPermissions2.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java b/src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java index 23a30f9..7e5807d 100644 --- a/src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java +++ b/src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java @@ -21,6 +21,7 @@ import java.util.Set; import net.milkbowl.vault.permission.Permission; import org.bukkit.Bukkit; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -88,6 +89,11 @@ public class Permission_bPermissions2 extends Permission { return hooked; } + @Override + public boolean has(Player player, String permission) { + return playerHas(player.getWorld().getName(), player.getName(), permission); + } + @Override public boolean playerHas(String world, String player, String permission) { return ApiLayer.hasPermission(world, CalculableType.USER, player, permission); From 9f7b395eeeb4277817968674ee644893f2bdd1d0 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 24 Aug 2012 02:12:05 +0200 Subject: [PATCH 2/2] Update src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java Proper HeroChat fix (YAY) --- .../plugins/Permission_bPermissions2.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java b/src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java index 7e5807d..fcd87de 100644 --- a/src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java +++ b/src/net/milkbowl/vault/permission/plugins/Permission_bPermissions2.java @@ -21,6 +21,7 @@ import java.util.Set; import net.milkbowl.vault.permission.Permission; import org.bukkit.Bukkit; +import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -88,13 +89,32 @@ public class Permission_bPermissions2 extends Permission { public boolean isEnabled() { return hooked; } - + @Override public boolean has(Player player, String permission) { return playerHas(player.getWorld().getName(), player.getName(), permission); } @Override + public boolean has(String world, String player, String permission) { + return playerHas(world, player, permission); + } + + @Override + public boolean has(CommandSender sender, String permission) { + if(sender instanceof Player) { + Player player = (Player) sender; + return has(player, permission); + } + return sender.hasPermission(permission); + } + + @Override + public boolean has(org.bukkit.World world, String player, String permission) { + return playerHas(world.getName(), player, permission); + } + + @Override public boolean playerHas(String world, String player, String permission) { return ApiLayer.hasPermission(world, CalculableType.USER, player, permission); }