mirror of
https://github.com/rockyhawk64/CommandPanels.git
synced 2025-11-18 07:14:17 +01:00
Fix to ISGREATER
Made isgreater clear all extra characters besides numbers, decimals, and - for negatives.
This commit is contained in:
parent
d314b50311
commit
12cd47642d
@ -122,8 +122,10 @@ public class HasSections {
|
||||
if(player != null){
|
||||
return player.hasPermission(compare) == outputValue;
|
||||
}
|
||||
}else if(value.endsWith(" ISGREATER")) {
|
||||
return (new BigDecimal(compare).compareTo(new BigDecimal(value.substring(0, value.length()-10).replace(",",""))) <= 0 == outputValue);
|
||||
}else if (value.endsWith(" ISGREATER")) {
|
||||
String numericPart = value.replaceAll("[^0-9.\\-]", ""); // allows negative and decimal numbers
|
||||
BigDecimal target = new BigDecimal(numericPart.replace(",", ""));
|
||||
return (new BigDecimal(compare).compareTo(target) <= 0) == outputValue;
|
||||
}else{
|
||||
return compare.equals(value) == outputValue;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user