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(); }