From ebb3714b166195a85db8140f722ffa4262db95ed Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Sun, 6 Oct 2024 21:31:54 -0400 Subject: [PATCH] Fix ScriptEngineHolder --- core/src/mindustry/client/ScriptEngineHolder.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/client/ScriptEngineHolder.kt b/core/src/mindustry/client/ScriptEngineHolder.kt index f4149d021e..4fa1d86072 100644 --- a/core/src/mindustry/client/ScriptEngineHolder.kt +++ b/core/src/mindustry/client/ScriptEngineHolder.kt @@ -1,8 +1,7 @@ package mindustry.client -import javax.script.ScriptEngine -import javax.script.ScriptEngineManager +import javax.script.* object ScriptEngineHolder { - val kts: ScriptEngine? by lazy { ScriptEngineManager().getEngineByExtension("kts") } + val kts: ScriptEngine? by lazy { ScriptEngineManager().getEngineByExtension("kts")?.apply { eval("import arc.*;import arc.audio.*;import arc.files.*;import arc.func.*;import arc.flabel.*;import arc.graphics.*;import arc.graphics.g2d.*;import arc.graphics.gl.*;import arc.input.*;import arc.math.*;import arc.math.geom.*;import arc.scene.*;import arc.scene.actions.*;import arc.scene.event.*;import arc.scene.style.*;import arc.scene.ui.*;import arc.scene.ui.layout.*;import arc.scene.utils.*;import arc.struct.*;import arc.util.*;import arc.util.io.*;import arc.util.noise.*;import arc.util.pooling.*;import arc.util.serialization.*;import arc.util.viewport.*;import mindustry.*;import mindustry.ai.*;import mindustry.ai.types.*;import mindustry.async.*;import mindustry.audio.*;import mindustry.content.*;import mindustry.core.*;import mindustry.ctype.*;import mindustry.editor.*;import mindustry.entities.*;import mindustry.entities.abilities.*;import mindustry.entities.bullet.*;import mindustry.entities.effect.*;import mindustry.entities.part.*;import mindustry.entities.pattern.*;import mindustry.entities.units.*;import mindustry.game.*;import mindustry.gen.*;import mindustry.graphics.*;import mindustry.graphics.g3d.*;import mindustry.input.*;import mindustry.io.*;import mindustry.logic.*;import mindustry.maps.*;import mindustry.maps.filters.*;import mindustry.maps.generators.*;import mindustry.maps.planet.*;import mindustry.net.*;import mindustry.service.*;import mindustry.type.*;import mindustry.type.ammo.*;import mindustry.type.unit.*;import mindustry.type.weapons.*;import mindustry.type.weather.*;import mindustry.ui.*;import mindustry.ui.dialogs.*;import mindustry.ui.fragments.*;import mindustry.ui.layout.*;import mindustry.world.*;import mindustry.world.blocks.*;import mindustry.world.blocks.campaign.*;import mindustry.world.blocks.defense.*;import mindustry.world.blocks.defense.turrets.*;import mindustry.world.blocks.distribution.*;import mindustry.world.blocks.environment.*;import mindustry.world.blocks.heat.*;import mindustry.world.blocks.legacy.*;import mindustry.world.blocks.liquid.*;import mindustry.world.blocks.logic.*;import mindustry.world.blocks.payloads.*;import mindustry.world.blocks.power.*;import mindustry.world.blocks.production.*;import mindustry.world.blocks.sandbox.*;import mindustry.world.blocks.storage.*;import mindustry.world.blocks.units.*;import mindustry.world.consumers.*;import mindustry.world.draw.*;import mindustry.world.meta.*;import mindustry.world.modules.*;import mindustry.client.*;import mindustry.client.antigrief.*;import mindustry.client.communication.*;import mindustry.client.crypto.*;import mindustry.client.navigation.*;import mindustry.client.navigation.waypoints.*;import mindustry.client.ui.*;import mindustry.client.utils.*;") } } } \ No newline at end of file