3.7.4 Fixes

This commit is contained in:
rockyhawk64 2020-08-04 18:35:59 +10:00
parent cba5975f76
commit af47603a49
2 changed files with 27 additions and 27 deletions

View File

@ -1,4 +1,4 @@
version: 3.7.3 version: 3.7.4
main: me.rockyhawk.commandPanels.commandpanels main: me.rockyhawk.commandPanels.commandpanels
name: CommandPanels name: CommandPanels
author: RockyHawk author: RockyHawk

View File

@ -1780,23 +1780,6 @@ public class commandpanels extends JavaPlugin {
} }
} }
if (cf.contains("panels." + panelName + ".item." + slot + ".hasgreater")) { if (cf.contains("panels." + panelName + ".item." + slot + ".hasgreater")) {
//loop through possible hasgreater 1,2,3,etc
for (int count = 0; Objects.requireNonNull(cf.getConfigurationSection("panels." + panelName + ".item." + slot)).getKeys(false).size() > count; count++) {
if (cf.contains("panels." + panelName + ".item." + slot + ".hasgreater" + count)) {
boolean outputValue = true;
//outputValue will default to true
if (cf.contains("panels." + panelName + ".item." + slot + ".hasgreater" + count + ".output")) {
//if output is true, and values match it will be this item, vice versa
outputValue = cf.getBoolean("panels." + panelName + ".item." + slot + ".hasgreater" + count + ".output");
}
int value = cf.getInt("panels." + panelName + ".item." + slot + ".hasgreater" + count + ".value");
double compare = Double.parseDouble(ChatColor.stripColor(papi(p,setCpPlaceholders(p,cf.getString("panels." + panelName + ".item." + slot + ".hasgreater" + count + ".compare")))));
if ((compare >= value) == outputValue) {
//onOpen being 3 means it is the editor panel.. hasgreater items cannot be included to avoid item breaking
return ".hasgreater" + count;
}
}
}
//this will do the hasgreater without any numbers //this will do the hasgreater without any numbers
boolean outputValue = true; boolean outputValue = true;
//outputValue will default to true //outputValue will default to true
@ -1810,21 +1793,25 @@ public class commandpanels extends JavaPlugin {
//onOpen being 3 means it is the editor panel.. hasgreater items cannot be included to avoid item breaking //onOpen being 3 means it is the editor panel.. hasgreater items cannot be included to avoid item breaking
return ".hasgreater"; return ".hasgreater";
} }
} //loop through possible hasgreater 1,2,3,etc
if (cf.contains("panels." + panelName + ".item." + slot + ".hasperm")) { for (int count = 0; Objects.requireNonNull(cf.getConfigurationSection("panels." + panelName + ".item." + slot)).getKeys(false).size() > count; count++) {
for(int count = 0; Objects.requireNonNull(cf.getConfigurationSection("panels." + panelName + ".item." + slot)).getKeys(false).size() > count; count++){ if (cf.contains("panels." + panelName + ".item." + slot + ".hasgreater" + count)) {
if (cf.contains("panels." + panelName + ".item." + slot + ".hasperm" + count) && cf.contains("panels." + panelName + ".item." + slot + ".hasperm" + count + ".perm")) { outputValue = true;
boolean outputValue = true;
//outputValue will default to true //outputValue will default to true
if (cf.contains("panels." + panelName + ".item." + slot + ".hasperm" + count + ".output")) { if (cf.contains("panels." + panelName + ".item." + slot + ".hasgreater" + count + ".output")) {
//if output is true, and values match it will be this item, vice versa //if output is true, and values match it will be this item, vice versa
outputValue = cf.getBoolean("panels." + panelName + ".item." + slot + ".hasperm" + count + ".output"); outputValue = cf.getBoolean("panels." + panelName + ".item." + slot + ".hasgreater" + count + ".output");
} }
if (p.hasPermission(Objects.requireNonNull(cf.getString("panels." + panelName + ".item." + slot + ".hasperm" + count + ".perm"))) == outputValue) { value = cf.getInt("panels." + panelName + ".item." + slot + ".hasgreater" + count + ".value");
return ".hasperm" + count; compare = Double.parseDouble(ChatColor.stripColor(papi(p,setCpPlaceholders(p,cf.getString("panels." + panelName + ".item." + slot + ".hasgreater" + count + ".compare")))));
if ((compare >= value) == outputValue) {
//onOpen being 3 means it is the editor panel.. hasgreater items cannot be included to avoid item breaking
return ".hasgreater" + count;
} }
} }
} }
}
if (cf.contains("panels." + panelName + ".item." + slot + ".hasperm")) {
//this will do hasperm with no numbers //this will do hasperm with no numbers
boolean outputValue = true; boolean outputValue = true;
//outputValue will default to true //outputValue will default to true
@ -1835,6 +1822,19 @@ public class commandpanels extends JavaPlugin {
if (p.hasPermission(Objects.requireNonNull(cf.getString("panels." + panelName + ".item." + slot + ".hasperm.perm"))) == outputValue) { if (p.hasPermission(Objects.requireNonNull(cf.getString("panels." + panelName + ".item." + slot + ".hasperm.perm"))) == outputValue) {
return ".hasperm"; return ".hasperm";
} }
for(int count = 0; Objects.requireNonNull(cf.getConfigurationSection("panels." + panelName + ".item." + slot)).getKeys(false).size() > count; count++){
if (cf.contains("panels." + panelName + ".item." + slot + ".hasperm" + count) && cf.contains("panels." + panelName + ".item." + slot + ".hasperm" + count + ".perm")) {
outputValue = true;
//outputValue will default to true
if (cf.contains("panels." + panelName + ".item." + slot + ".hasperm" + count + ".output")) {
//if output is true, and values match it will be this item, vice versa
outputValue = cf.getBoolean("panels." + panelName + ".item." + slot + ".hasperm" + count + ".output");
}
if (p.hasPermission(Objects.requireNonNull(cf.getString("panels." + panelName + ".item." + slot + ".hasperm" + count + ".perm"))) == outputValue) {
return ".hasperm" + count;
}
}
}
} }
return ""; return "";
} }