mirror of
https://github.com/songoda/EpicFurnaces.git
synced 2024-12-02 23:03:36 +01:00
Change call to ScriptEngineManager
This commit is contained in:
parent
29af6cb38f
commit
4a769e95bd
@ -218,7 +218,7 @@ public class Furnace {
|
|||||||
String equation = "(" + level.getPerformance() + " / 100) * " + cap;
|
String equation = "(" + level.getPerformance() + " / 100) * " + cap;
|
||||||
try {
|
try {
|
||||||
if (!cache.containsKey(equation)) {
|
if (!cache.containsKey(equation)) {
|
||||||
ScriptEngineManager mgr = new ScriptEngineManager();
|
ScriptEngineManager mgr = new ScriptEngineManager(null);
|
||||||
ScriptEngine engine = mgr.getEngineByName("JavaScript");
|
ScriptEngine engine = mgr.getEngineByName("JavaScript");
|
||||||
int num = (int) Math.round(Double.parseDouble(engine.eval("(" + level.getPerformance() + " / 100) * " + cap).toString()));
|
int num = (int) Math.round(Double.parseDouble(engine.eval("(" + level.getPerformance() + " / 100) * " + cap).toString()));
|
||||||
cache.put(equation, num);
|
cache.put(equation, num);
|
||||||
|
Loading…
Reference in New Issue
Block a user