Added ability to disable setInvisible on disguise commands
This commit is contained in:
@@ -97,25 +97,9 @@ public abstract class DisguiseBaseCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean passesCheck(HashMap<ArrayList<String>, Boolean> theirPermissions, ArrayList<String> usedOptions) {
|
||||
boolean hasPermission = false;
|
||||
|
||||
for (ArrayList<String> list : theirPermissions.keySet()) {
|
||||
boolean myPerms = true;
|
||||
|
||||
for (String option : usedOptions) {
|
||||
if (!(theirPermissions.get(list) && list.contains("*"))
|
||||
&& (list.contains(option) != theirPermissions.get(list))) {
|
||||
myPerms = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (myPerms) {
|
||||
hasPermission = true;
|
||||
}
|
||||
}
|
||||
return hasPermission;
|
||||
public boolean passesCheck(CommandSender sender, HashMap<ArrayList<String>, Boolean> theirPermissions,
|
||||
ArrayList<String> usedOptions) {
|
||||
return DisguiseParser.passesCheck(sender, theirPermissions, usedOptions);
|
||||
}
|
||||
|
||||
protected abstract void sendCommandUsage(CommandSender sender,
|
||||
|
@@ -114,7 +114,7 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter
|
||||
}
|
||||
}
|
||||
|
||||
if (passesCheck(perms.get(disguiseType), usedOptions)) {
|
||||
if (passesCheck(sender, perms.get(disguiseType), usedOptions)) {
|
||||
boolean addMethods = true;
|
||||
|
||||
if (args.length > 1) {
|
||||
|
@@ -98,7 +98,7 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom
|
||||
}
|
||||
}
|
||||
|
||||
if (passesCheck(perms.get(disguiseType), usedOptions)) {
|
||||
if (passesCheck(sender, perms.get(disguiseType), usedOptions)) {
|
||||
boolean addMethods = true;
|
||||
|
||||
if (args.length > 1) {
|
||||
|
@@ -150,7 +150,7 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom
|
||||
}
|
||||
}
|
||||
|
||||
if (passesCheck(perms.get(disguiseType), usedOptions)) {
|
||||
if (passesCheck(sender, perms.get(disguiseType), usedOptions)) {
|
||||
boolean addMethods = true;
|
||||
|
||||
if (args.length > 2) {
|
||||
|
@@ -261,7 +261,7 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
|
||||
}
|
||||
}
|
||||
|
||||
if (passesCheck(perms.get(disguiseType), usedOptions)) {
|
||||
if (passesCheck(sender, perms.get(disguiseType), usedOptions)) {
|
||||
boolean addMethods = true;
|
||||
|
||||
if (args.length > 1 + starting) {
|
||||
|
Reference in New Issue
Block a user