mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Now using commons math parser
This commit is contained in:
parent
59ef2d131a
commit
fd1c2f04f7
@ -2,7 +2,7 @@ package net.Indyuce.mmoitems.api.item.build;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import io.lumine.mythic.lib.MythicLib;
|
||||
import io.lumine.mythic.lib.api.math.EvaluatedFormula;
|
||||
import io.lumine.mythic.lib.parser.client.eval.DoubleEvaluator;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -159,7 +159,7 @@ public class LoreBuilder {
|
||||
|
||||
String result;
|
||||
try {
|
||||
result = MythicLib.plugin.getMMOConfig().decimals.format(new EvaluatedFormula(match).evaluate());
|
||||
result = MythicLib.plugin.getMMOConfig().decimals.format(new DoubleEvaluator().evaluate(match));
|
||||
} catch (RuntimeException ignored) {
|
||||
result = "<InvalidFormula>";
|
||||
}
|
||||
|
@ -2,9 +2,9 @@ package net.Indyuce.mmoitems.comp.parse.placeholders;
|
||||
|
||||
import io.lumine.mythic.lib.MythicLib;
|
||||
import io.lumine.mythic.lib.api.item.NBTItem;
|
||||
import io.lumine.mythic.lib.api.math.EvaluatedFormula;
|
||||
import io.lumine.mythic.lib.api.player.MMOPlayerData;
|
||||
import io.lumine.mythic.lib.api.util.AltChar;
|
||||
import io.lumine.mythic.lib.parser.client.eval.DoubleEvaluator;
|
||||
import io.lumine.mythic.lib.player.cooldown.CooldownInfo;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
@ -154,7 +154,7 @@ public class MMOItemsPlaceholders extends PlaceholderExpansion {
|
||||
String formula = MythicLib.plugin.getConfig().getString("defense-application", "#damage# * (1 - (#defense# / (#defense# + 100)))");
|
||||
formula = formula.replace("#defense#", String.valueOf(data.getStatMap().getStat("DEFENSE")));
|
||||
formula = formula.replace("#damage#", String.valueOf(100));
|
||||
return Math.max(0, new EvaluatedFormula(formula).evaluate());
|
||||
return Math.max(0, new DoubleEvaluator().evaluate(formula));
|
||||
}
|
||||
|
||||
private String getCurrentDurabilityBar(ItemStack item, String barChar, int length) {
|
||||
|
Loading…
Reference in New Issue
Block a user