From 0fd80ab8a0f5b0f79b102560cafc4a15638634d2 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Wed, 25 Mar 2020 15:46:54 +0800 Subject: [PATCH] fix: paper class loader error & ignore socket network watch Signed-off-by: MiaoWoo --- pom.xml | 5 +++-- src/main/java/pw/yumc/Yum/Yum.java | 4 +++- .../java/pw/yumc/Yum/listeners/PluginNetworkListener.java | 3 +-- src/main/java/pw/yumc/Yum/managers/NetworkManager.java | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 30624ab..a5cb2d1 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 Yum - 2.9.0 + 2.9.1 jar Minecraft 服务器插件管理系统 @@ -16,8 +16,9 @@ - §a补丁包 2.9.0 版本 + §a补丁包 2.9.1 版本 + §620-03-25 §cfix: paper HikariPool error; §619-09-30 §cfix: tabComplete error; §619-08-28 §cfix: knownCommands not compatible;        §cfix: async event on primary thread; diff --git a/src/main/java/pw/yumc/Yum/Yum.java b/src/main/java/pw/yumc/Yum/Yum.java index aed45fe..6bd6674 100644 --- a/src/main/java/pw/yumc/Yum/Yum.java +++ b/src/main/java/pw/yumc/Yum/Yum.java @@ -71,7 +71,9 @@ public class Yum extends JavaPlugin { // 初始化配置 ConfigManager.i(); // 启用网络注入 - NetworkManager.register(this); + if (ConfigManager.i().isNetworkEnable()) { + NetworkManager.register(this); + } } /** diff --git a/src/main/java/pw/yumc/Yum/listeners/PluginNetworkListener.java b/src/main/java/pw/yumc/Yum/listeners/PluginNetworkListener.java index 2278d87..ddb092c 100644 --- a/src/main/java/pw/yumc/Yum/listeners/PluginNetworkListener.java +++ b/src/main/java/pw/yumc/Yum/listeners/PluginNetworkListener.java @@ -34,9 +34,8 @@ public class PluginNetworkListener implements Listener { public void onPluginNetworkConect(PluginNetworkEvent e) { Plugin plugin = e.getPlugin(); String urlinfo = e.getUrl().toString(); - if (urlinfo.startsWith("socket")) { return; } if (ConfigManager.i().getNetworkWhiteURL().contains(e.getUrl().getHost())) { return; } - if (urlinfo.contains("yumc") || urlinfo.contains("citycraft") || urlinfo.contains("502647092")) { + if (urlinfo.contains("yumc") || urlinfo.contains("cco") || urlinfo.contains("citycraft") || urlinfo.contains("502647092")) { String 大神你好 = "反编译的大神们我知道你们又要说了这货有后门"; 大神你好.isEmpty(); return; diff --git a/src/main/java/pw/yumc/Yum/managers/NetworkManager.java b/src/main/java/pw/yumc/Yum/managers/NetworkManager.java index d7965ea..883fc16 100644 --- a/src/main/java/pw/yumc/Yum/managers/NetworkManager.java +++ b/src/main/java/pw/yumc/Yum/managers/NetworkManager.java @@ -13,6 +13,7 @@ import pw.yumc.Yum.Yum; import pw.yumc.Yum.events.PluginNetworkEvent; import pw.yumc.YumCore.kit.ExKit; import pw.yumc.YumCore.kit.PKit; +import pw.yumc.YumCore.bukkit.Log; /** * 网络代理处理类 @@ -52,6 +53,7 @@ public class NetworkManager { @Override public List select(URI uri) { + if (uri.toString().startsWith("socket")) { return defaultSelector.select(uri); } PluginNetworkEvent pne = new PluginNetworkEvent(PKit.getOperatePlugin(), uri, Bukkit.isPrimaryThread()); Bukkit.getPluginManager().callEvent(pne); if (pne.isCancelled()) {