Permission update for plugin.yml

Also updated Permission to have a toString
  that gives the full node in case another
  dev wishes to check anticheat perms via hooking
Yay
This commit is contained in:
Matt Baxter committed 2012-06-11 23:57:34 -04:00
1 parent ae14ff694b
commit 7c904bbeda
2 files changed
+56 -60

No files matched your search

@@ -1,7 +1,7 @@
package net.h31ix.anticheat;
import org.bukkit.command.CommandSender;
public enum Permission
{
/* Check Nodes */
@@ -27,7 +27,7 @@ public enum Permission
CHECK_LONGREACH,
CHECK_FASTPROJECTILE,
CHECK_ITEMSPAM,
/* System Nodes */
SYSTEM_LOG,
SYSTEM_XRAY,
@@ -37,20 +37,16 @@ public enum Permission
SYSTEM_UPDATE,
SYSTEM_REPORT,
SYSTEM_RELOAD;
public boolean get(CommandSender cs)
{
return cs.hasPermission(parsePermissionNode());
return cs.hasPermission(toString());
}
private String parsePermissionNode()
@Override
public String toString()
{
return "anticheat." + parse();
return "anticheat." + this.name().toLowerCase().replace("_", ".");
}
private String parse()
{
return this.name().toLowerCase().replace("_", ".");
}
}