From 7ee65d26b261e5d6f9e63581cac133673259254e Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 23 Jan 2020 09:42:01 +1300 Subject: [PATCH] Allow disguise options on all parameters --- .../disguise/utilities/parser/DisguiseParser.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java b/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java index a8d6b7ca..d6b1de8c 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java @@ -722,7 +722,7 @@ public class DisguiseParser { DisguiseParseException { Method[] methods = ParamInfoManager.getDisguiseWatcherMethods(disguise.getWatcher().getClass()); List list = new ArrayList<>(Arrays.asList(args)); - HashMap disguiseOptions = null; + HashMap disguiseOptions = getDisguiseOptions(sender, permNode, disguisePerm); for (int argIndex = 0; argIndex < args.length; argIndex++) { // This is the method name they provided @@ -787,14 +787,7 @@ public class DisguiseParser { usedOptions.add(methodToUse.getName().toLowerCase()); } - if (methodToUse.getName().equalsIgnoreCase("setpainting") || - methodToUse.getName().equalsIgnoreCase("setpotionid") || - methodToUse.getName().equalsIgnoreCase("setitemstack") || - methodToUse.getName().equalsIgnoreCase("setblock")) { - if (disguiseOptions == null) { - disguiseOptions = getDisguiseOptions(sender, permNode, disguisePerm); - } - + if (!disguiseOptions.isEmpty()) { String stringValue = ParamInfoManager.toString(valueToSet); if (!hasPermissionOption(disguiseOptions, stringValue)) {