From 6a5019195ed35a091b600cd3c81b36c664fccc0e Mon Sep 17 00:00:00 2001 From: rockyhawk64 Date: Tue, 7 Sep 2021 19:46:50 +1000 Subject: [PATCH] 3.17.1.1 --- resource/plugin.yml | 2 +- .../commandpanels/classresources/HasSections.java | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/resource/plugin.yml b/resource/plugin.yml index 330357e..1aac4a4 100644 --- a/resource/plugin.yml +++ b/resource/plugin.yml @@ -1,4 +1,4 @@ -version: 3.17.1.0 +version: 3.17.1.1 main: me.rockyhawk.commandpanels.CommandPanels name: CommandPanels author: RockyHawk diff --git a/src/me/rockyhawk/commandpanels/classresources/HasSections.java b/src/me/rockyhawk/commandpanels/classresources/HasSections.java index 6d9eb9e..74c1cf8 100644 --- a/src/me/rockyhawk/commandpanels/classresources/HasSections.java +++ b/src/me/rockyhawk/commandpanels/classresources/HasSections.java @@ -33,9 +33,12 @@ public class HasSections { continue; } + boolean endProcess = true; //loop through possible values and compares for hypothetical and operators for (int a = 0; cf.getConfigurationSection(setName).getKeys(false).size() > a; a++) { if(cf.isSet(setName + ".value" + a) && cf.isSet(setName + ".compare" + a)){ + //ensure the endProcess variable has been reset for another operation + endProcess = true; //get the values of this statement String value = ChatColor.stripColor(plugin.tex.placeholders(panel, position, p, cf.getString(setName + ".value" + a))); String compare = ChatColor.stripColor(plugin.tex.placeholders(panel, position, p, cf.getString(setName + ".compare" + a))); @@ -51,7 +54,6 @@ public class HasSections { //list of values with the or operator HashSet values = doOperators(new HashSet<>(Collections.singletonList(value))); //go through all values with the or operator - boolean endProcess = true; for(String val : values){ if (hasProcess(setName, val, compare, p)) { endProcess = false; @@ -65,12 +67,17 @@ public class HasSections { //check if the operator link between the next value/compare is OR if(operator.equals("OR")){ //I can just continue because the algorithm already assumes the last sequence was true + endProcess = false; continue; } - return ""; + break; } } } + //if the has section is false move to the next has section + if(endProcess){ + continue; + } //proceed if none of the values were false return "." + setName + hasSection(panel, position, cf.getConfigurationSection(setName), p); }