From 2a6950231e760a6c7f6b80ca98ba28076aba2976 Mon Sep 17 00:00:00 2001 From: MiniDay <372403923@qq.com> Date: Sun, 17 Mar 2024 22:11:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(core-velocity):=20=E4=B8=BA=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E5=92=8C=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=9A=84=E5=A4=84=E7=90=86=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BC=98=E5=85=88=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mc/plugin/core/velocity/HamsterCorePlugin.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core-velocity/src/main/java/cn/hamster3/mc/plugin/core/velocity/HamsterCorePlugin.java b/core-velocity/src/main/java/cn/hamster3/mc/plugin/core/velocity/HamsterCorePlugin.java index f836851..0c8fe41 100644 --- a/core-velocity/src/main/java/cn/hamster3/mc/plugin/core/velocity/HamsterCorePlugin.java +++ b/core-velocity/src/main/java/cn/hamster3/mc/plugin/core/velocity/HamsterCorePlugin.java @@ -3,6 +3,7 @@ package cn.hamster3.mc.plugin.core.velocity; import cn.hamster3.mc.plugin.core.common.api.CoreAPI; import cn.hamster3.mc.plugin.core.velocity.api.CoreVelocityAPI; import com.google.inject.Inject; +import com.velocitypowered.api.event.PostOrder; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.proxy.ProxyInitializeEvent; import com.velocitypowered.api.event.proxy.ProxyShutdownEvent; @@ -67,18 +68,16 @@ public class HamsterCorePlugin { slf4jLogger.info("HamsterCore 初始化完成,总计耗时 " + time + " ms"); } - @Subscribe + @Subscribe(order = PostOrder.FIRST) public void onProxyInitialization(ProxyInitializeEvent event) { long start = System.currentTimeMillis(); slf4jLogger.info("仓鼠核心正在启动"); -// CoreMessage.init(getLogger(), new File(dataFolder, "messages.yml")); -// logger.info("已初始化语言文本"); long time = System.currentTimeMillis() - start; slf4jLogger.info("仓鼠核心启动完成,总计耗时 " + time + " ms"); } - @Subscribe - public void onProxyInitialization(ProxyShutdownEvent event) { + @Subscribe(order = PostOrder.LAST) + public void onProxyShutdown(ProxyShutdownEvent event) { long start = System.currentTimeMillis(); CoreAPI.getInstance().getJedisPool().close(); slf4jLogger.info("已关闭 Redis 连接池");