|
@@ -22,18 +22,27 @@ public class PermissionManager extends Module implements ICommandManager
|
|
|
{
|
|
|
private final HashMap<UUID, ArrayList<Integer>> playerGroups;
|
|
|
private final ArrayList<HashSet<String>> stringGroupPerms;
|
|
|
+ private final HashSet<String> worldedit = new HashSet<>();
|
|
|
|
|
|
public PermissionManager(String mname, String prefix, TextFormatting color)
|
|
|
{
|
|
|
super(mname, prefix, color);
|
|
|
playerGroups = new HashMap<>();
|
|
|
stringGroupPerms = new ArrayList<>();
|
|
|
+ addGroups();
|
|
|
}
|
|
|
|
|
|
public void clear()
|
|
|
{
|
|
|
playerGroups.clear();
|
|
|
stringGroupPerms.clear();
|
|
|
+ addGroups();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void addGroups()
|
|
|
+ {
|
|
|
+ stringGroupPerms.add(new HashSet<>());
|
|
|
+ stringGroupPerms.add(worldedit);
|
|
|
}
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
@@ -109,6 +118,10 @@ public class PermissionManager extends Module implements ICommandManager
|
|
|
{
|
|
|
throw new IllegalArgumentException("empty permission string");
|
|
|
}
|
|
|
+ if(id == 1)
|
|
|
+ {
|
|
|
+ throw new IllegalArgumentException("id 1 is reserved for worldedit");
|
|
|
+ }
|
|
|
if(id >= stringGroupPerms.size())
|
|
|
{
|
|
|
HashSet<String> set = new HashSet<>();
|
|
@@ -146,4 +159,13 @@ public class PermissionManager extends Module implements ICommandManager
|
|
|
{
|
|
|
cs.sendMessage(new TextComponentString("Keine Perms für " + command.getName()));
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onRegisterCommand(ICommand command, String domain)
|
|
|
+ {
|
|
|
+ if(domain.startsWith("com.sk89q"))
|
|
|
+ {
|
|
|
+ worldedit.add(command.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|