mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
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:
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("_", ".");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user