From 14cbbcad1515c40b7a1f1fdd708c6bcc881ba8d4 Mon Sep 17 00:00:00 2001 From: Monzter Date: Sat, 28 Aug 2021 22:21:52 +0000 Subject: [PATCH] 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. --- .../api/crafting/condition/PlaceholderCondition.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/Indyuce/mmoitems/api/crafting/condition/PlaceholderCondition.java b/src/main/java/net/Indyuce/mmoitems/api/crafting/condition/PlaceholderCondition.java index e12deb62..00e46132 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/crafting/condition/PlaceholderCondition.java +++ b/src/main/java/net/Indyuce/mmoitems/api/crafting/condition/PlaceholderCondition.java @@ -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);