feat: 调整启动逻辑 兼容 Arclight

Signed-off-by: MiaoWoo <admin@yumc.pw>
master
MiaoWoo 2021-06-25 02:44:19 +00:00
parent 7b171f1546
commit fc7fb67023
2 changed files with 7 additions and 4 deletions

View File

@ -1,8 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pw.yumc</groupId>
<artifactId>MiaoScript</artifactId>
<version>0.13.1</version>
<version>0.15.0</version>
<developers>
<developer>
<id>502647092</id>
@ -53,6 +54,7 @@
<properties>
<env.GIT_COMMIT>DEV</env.GIT_COMMIT>
<update.changes>
§621-06-25 §afeat: 调整启动逻辑 兼容 Arclight;
§621-06-22 §afeat: 新增本地版本锁定功能;
§621-06-19 §afeat: 兼容JDK16 反射异常;
§621-05-15 §afeat: 兼容JDK15+ 自动下载Nashorn类库;

View File

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