mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-21 11:55:15 +01:00
don't kick if plugin message transformation fails
This commit is contained in:
parent
df5f4c67c8
commit
6db0559906
@ -61,8 +61,8 @@ dependencies {
|
||||
implementation(kotlin("stdlib-jdk8"))
|
||||
implementation(kotlin("reflect"))
|
||||
|
||||
val vvVer = "4.7.0-23w16a-SNAPSHOT"
|
||||
val vbVer = "4.7.0-23w16a-SNAPSHOT"
|
||||
val vvVer = "4.7.0-23w18a-SNAPSHOT"
|
||||
val vbVer = "4.7.0-23w18a-SNAPSHOT"
|
||||
val vrVer = "5f7fdc5"
|
||||
implementation("com.viaversion:viaversion:$vvVer") { isTransitive = false }
|
||||
implementation("com.viaversion:viabackwards:$vbVer") { isTransitive = false }
|
||||
|
@ -58,19 +58,23 @@ class PlayState : ConnectionState {
|
||||
|
||||
private fun modifyPluginMessage(handler: MinecraftHandler, pluginMessage: PluginMessage) {
|
||||
if (handler.frontEnd) return
|
||||
when (pluginMessage.channel) {
|
||||
"MC|Brand", "brand", "minecraft:brand" -> {
|
||||
if (!VIAaaSConfig.showBrandInfo) return
|
||||
try {
|
||||
when (pluginMessage.channel) {
|
||||
"MC|Brand", "brand", "minecraft:brand" -> {
|
||||
if (!VIAaaSConfig.showBrandInfo) return
|
||||
|
||||
val brand = "${
|
||||
decodeBrand(
|
||||
pluginMessage.data,
|
||||
is17(handler)
|
||||
)
|
||||
}${" (VIAaaS C: ${handler.data.frontVer?.parseProtocol()} S: ${handler.data.backServerVer?.parseProtocol()})"}"
|
||||
val brand = "${
|
||||
decodeBrand(
|
||||
pluginMessage.data,
|
||||
is17(handler)
|
||||
)
|
||||
}${" (VIAaaS C: ${handler.data.frontVer?.parseProtocol()} S: ${handler.data.backServerVer?.parseProtocol()})"}"
|
||||
|
||||
pluginMessage.data = encodeBrand(brand, is17(handler))
|
||||
pluginMessage.data = encodeBrand(brand, is17(handler))
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
mcLogger.debug("Couldn't modify plugin message", e)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user