From cde2728b0861a39ddd2fdc4403b3aa27e4d690bd Mon Sep 17 00:00:00 2001 From: acrylic-style Date: Tue, 27 Dec 2022 21:25:02 +0900 Subject: [PATCH] :bookmark: 4.0.3 - bug fix only --- build.gradle.kts | 2 +- .../azipluginmessaging/velocity/VelocityPlugin.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 392ea78..12cb11e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "net.azisaba.azipluginmessaging" -version = "4.0.2" +version = "4.0.3" repositories { mavenCentral() diff --git a/velocity/src/main/java/net/azisaba/azipluginmessaging/velocity/VelocityPlugin.java b/velocity/src/main/java/net/azisaba/azipluginmessaging/velocity/VelocityPlugin.java index 0638087..8244b3b 100644 --- a/velocity/src/main/java/net/azisaba/azipluginmessaging/velocity/VelocityPlugin.java +++ b/velocity/src/main/java/net/azisaba/azipluginmessaging/velocity/VelocityPlugin.java @@ -3,6 +3,7 @@ import com.google.inject.Inject; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.connection.PluginMessageEvent; +import com.velocitypowered.api.event.proxy.ProxyInitializeEvent; import com.velocitypowered.api.event.proxy.ProxyShutdownEvent; import com.velocitypowered.api.plugin.Dependency; import com.velocitypowered.api.plugin.Plugin; @@ -24,14 +25,21 @@ @Plugin(id = "azi-plugin-messaging", name = "AziPluginMessaging", version = "4.0.0", dependencies = @Dependency(id = "luckperms")) public class VelocityPlugin { + private final ProxyServer server; + @Inject public VelocityPlugin(@NotNull ProxyServer server, @NotNull Logger logger) { + this.server = server; server.getChannelRegistrar().register(new LegacyChannelIdentifier(Protocol.LEGACY_CHANNEL_ID)); server.getChannelRegistrar().register(MinecraftChannelIdentifier.from(Protocol.CHANNEL_ID)); AziPluginMessagingVelocity api = new AziPluginMessagingVelocity(server, logger); AziPluginMessagingProviderProvider.register(api); AziPluginMessagingConfig.reload(); DBConnector.init(); + } + + @Subscribe + public void onProxyInitialization(ProxyInitializeEvent e) { server.getScheduler() .buildTask(this, () -> { // check rank expiration