Skip to content

Commit 14cc05e

Browse files
committed
feat: support BungeeCord at JDK17
Signed-off-by: MiaoWoo <admin@yumc.pw>
1 parent ebc03b6 commit 14cc05e

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>pw.yumc</groupId>
44
<artifactId>MiaoScript</artifactId>
5-
<version>0.23.0</version>
5+
<version>0.23.1</version>
66
<developers>
77
<developer>
88
<id>502647092</id>
@@ -50,6 +50,8 @@
5050
<properties>
5151
<env.GIT_COMMIT>DEV</env.GIT_COMMIT>
5252
<update.changes>
53+
§622-06-21 §afeat: 兼容 1.7.10-1.19 版本;
54+
      §afeat: 兼容 JDK17 BungeeCord;
5355
§622-05-25 §afeat: 兼容 1.7.10-1.18.2 版本;
5456
§622-05-21 §afeat: 优化 框架加载逻辑;
5557
§622-05-20 §afeat: 调整 require 主包逻辑;

src/main/java/pw/yumc/MiaoScript/api/MiaoScriptAPI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.nio.file.Paths;
99

1010
public class MiaoScriptAPI {
11-
public static final String VERSION = "0.23.0";
11+
public static final String VERSION = "0.23.1";
1212
private static String root;
1313
private static String libPath;
1414
private static ScriptEngine scriptEngine;

src/main/java/pw/yumc/MiaoScript/engine/MiaoScriptEngine.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ public MiaoScriptEngine(String engineRoot) {
3535
}
3636

3737
private void loadGraalJS(String engineRoot) {
38-
this.engine = this.parentLoadNetworkNashorn(engineRoot);
38+
try {
39+
this.engine = this.parentLoadNetworkNashorn(engineRoot);
40+
} catch (Throwable ex) {
41+
this.engine = this.loadNetworkNashorn(engineRoot);
42+
}
3943
if (this.engine == null) {
4044
this.engine = this.loadNetworkGraalJS(engineRoot);
4145
}
@@ -56,7 +60,7 @@ private void loadNashorn(String engineRoot) {
5660
ex.printStackTrace();
5761
}
5862
try {
59-
if (this.engine == null && engineRoot != null) {
63+
if (this.engine == null) {
6064
this.engine = this.loadNetworkNashorn(engineRoot);
6165
}
6266
} catch (final Throwable ex) {

0 commit comments

Comments
 (0)