diff --git a/src/main/java/pw/yumc/MiaoScript/MiaoScriptSponge.java b/src/main/java/pw/yumc/MiaoScript/MiaoScriptSponge.java index 73cd1e5..d036532 100644 --- a/src/main/java/pw/yumc/MiaoScript/MiaoScriptSponge.java +++ b/src/main/java/pw/yumc/MiaoScript/MiaoScriptSponge.java @@ -89,7 +89,7 @@ public class MiaoScriptSponge { engine.disableEngine(); Sponge.getEventManager().unregisterPluginListeners(this); engine.enableEngine(); - // src.sendMesssage("§6[§bMiaoScript§6]§r §bMiaoScript §eEngine §a重启完成!"); + src.sendMessage(Text.of("§6[§bMiaoScript§6]§r §bMiaoScript §eEngine §a重启完成!")); return CommandResult.success(); }) .build(); @@ -101,5 +101,6 @@ public class MiaoScriptSponge { Sponge.getServer().getConsole(); Sponge.getCommandManager().register(this, main(), "ms", "mscript", "MiaoScript"); engine = new ScriptEngine(pluginConfigDir.getCanonicalPath(), logger); + engine.enableEngine(); } } diff --git a/src/main/java/pw/yumc/MiaoScript/ScriptEngine.java b/src/main/java/pw/yumc/MiaoScript/ScriptEngine.java index e538c6c..6469186 100644 --- a/src/main/java/pw/yumc/MiaoScript/ScriptEngine.java +++ b/src/main/java/pw/yumc/MiaoScript/ScriptEngine.java @@ -35,7 +35,7 @@ public class ScriptEngine { public void enableEngine(ClassLoader loader) { val origin = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(loader); - ScriptEngineManager manager = new ScriptEngineManager(null); + ScriptEngineManager manager = new ScriptEngineManager(); this.engine = new MiaoScriptEngine(manager, "nashorn"); this.engine.put("base", new Base()); Path bios = Paths.get(root, "bios.js");