From bf8201e9d2ef2677c70ff5914c5487473640a141 Mon Sep 17 00:00:00 2001 From: coding Date: Sat, 11 Nov 2017 08:34:03 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/pw/yumc/MiaoScript/MiaoScriptSponge.java | 3 ++- src/main/java/pw/yumc/MiaoScript/ScriptEngine.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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");