Fixed Crafting Station Placeholder Condition

- `=`s cannot be used as comparators. Instead replace them with a `+`
For example, `placeholder{placeholder=%mmocore_profession_mining%~<+~20}` is less than or equal to
`placeholder{placeholder=%mmocore_profession_mining%~+~20}` is equal to

If using `+` gives you incorrect results when attempting to see if something is equal (Says that it is not equal, even though it is), use `equals` instead. Greater than or equal to & Less than or equal to, should NOT have incorrect results, only direct `+` equal to comparisons may.

So if `placeholder{placeholder=%mmocore_profession_mining%~++~20}` result is incorrect, then use `placeholder{placeholder=%mmocore_profession_mining%~equals~20}` instead.
This commit is contained in:
Monzter 2021-08-28 22:21:52 +00:00
parent e174d501e9
commit 14cbbcad15

View File

@ -27,16 +27,16 @@ public class PlaceholderCondition extends Condition {
switch (comparator) {
case "<":
return Double.valueOf(placeholders) < Double.valueOf(compareTo);
case "<=":
case "<+":
return Double.valueOf(placeholders) <= Double.valueOf(compareTo);
case ">":
return Double.valueOf(placeholders) > Double.valueOf(compareTo);
case ">=":
case ">+":
return Double.valueOf(placeholders) >= Double.valueOf(compareTo);
case "==":
case "=":
case "++":
case "+":
return Double.valueOf(placeholders) == Double.valueOf(compareTo);
case "!=":
case "!+":
return Double.valueOf(placeholders) != Double.valueOf(compareTo);
case "equals":
return placeholders.equals(compareTo);