summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect/src/net/ess3/protect/BlockPlacePermissions.java
diff options
context:
space:
mode:
authorementalo <ementalodev@gmx.co.uk>2012-07-17 12:26:55 +0100
committerementalo <ementalodev@gmx.co.uk>2012-07-17 14:21:03 +0100
commita661bce7b3de3f53e2b7b79c1283f0affa6fe9c3 (patch)
tree2aa10b6300f6c8d3cb2b298c124180fade74857a /EssentialsProtect/src/net/ess3/protect/BlockPlacePermissions.java
parent3c385e69271dfe8530fadc3f67e13ee495e4b0e1 (diff)
parent9f05e43ecf8e6e1a8fcaef757678e762f0d82573 (diff)
downloadEssentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar
Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar.gz
Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar.lz
Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar.xz
Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.zip
Merge of server-layer branch
Diffstat (limited to 'EssentialsProtect/src/net/ess3/protect/BlockPlacePermissions.java')
-rw-r--r--EssentialsProtect/src/net/ess3/protect/BlockPlacePermissions.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/EssentialsProtect/src/net/ess3/protect/BlockPlacePermissions.java b/EssentialsProtect/src/net/ess3/protect/BlockPlacePermissions.java
new file mode 100644
index 000000000..87e771e73
--- /dev/null
+++ b/EssentialsProtect/src/net/ess3/protect/BlockPlacePermissions.java
@@ -0,0 +1,46 @@
+package net.ess3.protect;
+
+import net.ess3.api.IPermission;
+import net.ess3.permissions.AbstractSuperpermsPermission;
+import java.util.EnumMap;
+import java.util.Locale;
+import java.util.Map;
+import org.bukkit.Material;
+import org.bukkit.permissions.PermissionDefault;
+
+
+public class BlockPlacePermissions extends AbstractSuperpermsPermission
+{
+ private static Map<Material, IPermission> permissions = new EnumMap<Material, IPermission>(Material.class);
+ private static final String base = "essentials.protect.blockplace.";
+ private final String permission;
+
+ public static IPermission getPermission(final Material mat)
+ {
+ IPermission perm = permissions.get(mat);
+ if (perm == null)
+ {
+ perm = new BlockPlacePermissions(mat.toString().toLowerCase(Locale.ENGLISH));
+ permissions.put(mat, perm);
+ }
+ return perm;
+ }
+
+ private BlockPlacePermissions(final String matName)
+ {
+ super();
+ this.permission = base + matName;
+ }
+
+ @Override
+ public String getPermission()
+ {
+ return this.permission;
+ }
+
+ @Override
+ public PermissionDefault getPermissionDefault()
+ {
+ return PermissionDefault.TRUE;
+ }
+}