From fc7fb670232091e5b4e4dcb667ddbaac7dd9ec79 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Fri, 25 Jun 2021 02:44:19 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E9=80=BB=E8=BE=91=20=E5=85=BC=E5=AE=B9=20Arclight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MiaoWoo --- pom.xml | 6 ++++-- src/main/java/pw/yumc/MiaoScript/MiaoScript.java | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index df1a59e..e57576e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,8 +1,9 @@ - + 4.0.0 pw.yumc MiaoScript - 0.13.1 + 0.15.0 502647092 @@ -53,6 +54,7 @@ DEV + §621-06-25 §afeat: 调整启动逻辑 兼容 Arclight; §621-06-22 §afeat: 新增本地版本锁定功能; §621-06-19 §afeat: 兼容JDK16 反射异常; §621-05-15 §afeat: 兼容JDK15+ 自动下载Nashorn类库; diff --git a/src/main/java/pw/yumc/MiaoScript/MiaoScript.java b/src/main/java/pw/yumc/MiaoScript/MiaoScript.java index 8deac2f..9ecf16e 100644 --- a/src/main/java/pw/yumc/MiaoScript/MiaoScript.java +++ b/src/main/java/pw/yumc/MiaoScript/MiaoScript.java @@ -1,8 +1,7 @@ package pw.yumc.MiaoScript; -import org.bukkit.plugin.java.JavaPlugin; - import lombok.SneakyThrows; +import org.bukkit.plugin.java.JavaPlugin; /** * 喵式脚本 @@ -16,8 +15,10 @@ public class MiaoScript extends JavaPlugin { @Override @SneakyThrows public void onLoad() { + ClassLoader origin = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(getClassLoader()); engine = new ScriptEngine(getDataFolder().getCanonicalPath(), getLogger(), this); + Thread.currentThread().setContextClassLoader(origin); engine.loadEngine(); }