diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-02-11 05:03:44 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-02-11 05:03:44 +0900 |
| commit | 32fc6180bdc2a04f5a3c3d275ac03024905c92cc (patch) | |
| tree | 0b2a298feab574262fa418b775d8bf34a33da856 /platform-velocity | |
| parent | b80fa597a597c099e2f18d7c9c199a7b986255a8 (diff) | |
| download | LunaticChat-32fc6180bdc2a04f5a3c3d275ac03024905c92cc.tar.gz LunaticChat-32fc6180bdc2a04f5a3c3d275ac03024905c92cc.tar.bz2 LunaticChat-32fc6180bdc2a04f5a3c3d275ac03024905c92cc.zip | |
fix: Fix not updated Velocity metadata
Diffstat (limited to 'platform-velocity')
| -rw-r--r-- | platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/LunaticChat.kt | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/LunaticChat.kt b/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/LunaticChat.kt index 77b8c97..be5a4cd 100644 --- a/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/LunaticChat.kt +++ b/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/LunaticChat.kt @@ -5,6 +5,7 @@ import com.velocitypowered.api.event.Subscribe import com.velocitypowered.api.event.proxy.ProxyInitializeEvent import com.velocitypowered.api.event.proxy.ProxyShutdownEvent import com.velocitypowered.api.plugin.Plugin +import com.velocitypowered.api.plugin.PluginContainer import com.velocitypowered.api.proxy.ProxyServer import dev.m1sk9.lunaticChat.velocity.messaging.CrossServerChatRelay import dev.m1sk9.lunaticChat.velocity.messaging.PluginMessageHandler @@ -14,11 +15,14 @@ import org.slf4j.Logger * LunaticChat Velocity plugin * * Handles plugin messaging in coordination with Paper servers. + * + * Note: The version in this annotation is not used at runtime. + * The actual version is loaded from velocity-plugin.json via PluginContainer. */ @Plugin( id = "lunaticchat", name = "LunaticChat", - version = "0.8.0", + version = "0.0.0", description = "Next-generation channel chat plugin for Paper/Velocity", url = "https://lc.m1sk9.dev", authors = ["m1sk9"], @@ -28,6 +32,7 @@ class LunaticChat constructor( private val server: ProxyServer, private val logger: Logger, + private val pluginContainer: PluginContainer, ) { private var messageHandler: PluginMessageHandler? = null private var crossServerChatRelay: CrossServerChatRelay? = null @@ -36,6 +41,12 @@ class LunaticChat fun onProxyInitialization(event: ProxyInitializeEvent) { logger.info("Initializing LunaticChat Velocity plugin") + // Get plugin version from velocity-plugin.json (via PluginContainer) + val pluginVersion = + pluginContainer.description.version.orElseThrow { + IllegalStateException("Plugin version not found in velocity-plugin.json") + } + // Initialize cross-server chat relay crossServerChatRelay = CrossServerChatRelay( @@ -49,7 +60,7 @@ class LunaticChat plugin = this@LunaticChat, server = server, logger = logger, - pluginVersion = "0.8.0", + pluginVersion = pluginVersion, crossServerChatRelay = crossServerChatRelay!!, ) messageHandler?.initialize() |
