mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-09-30 04:57:50 +02: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("stdlib-jdk8"))
|
||||||
implementation(kotlin("reflect"))
|
implementation(kotlin("reflect"))
|
||||||
|
|
||||||
val vvVer = "4.7.0-23w16a-SNAPSHOT"
|
val vvVer = "4.7.0-23w18a-SNAPSHOT"
|
||||||
val vbVer = "4.7.0-23w16a-SNAPSHOT"
|
val vbVer = "4.7.0-23w18a-SNAPSHOT"
|
||||||
val vrVer = "5f7fdc5"
|
val vrVer = "5f7fdc5"
|
||||||
implementation("com.viaversion:viaversion:$vvVer") { isTransitive = false }
|
implementation("com.viaversion:viaversion:$vvVer") { isTransitive = false }
|
||||||
implementation("com.viaversion:viabackwards:$vbVer") { isTransitive = false }
|
implementation("com.viaversion:viabackwards:$vbVer") { isTransitive = false }
|
||||||
|
@ -58,19 +58,23 @@ class PlayState : ConnectionState {
|
|||||||
|
|
||||||
private fun modifyPluginMessage(handler: MinecraftHandler, pluginMessage: PluginMessage) {
|
private fun modifyPluginMessage(handler: MinecraftHandler, pluginMessage: PluginMessage) {
|
||||||
if (handler.frontEnd) return
|
if (handler.frontEnd) return
|
||||||
when (pluginMessage.channel) {
|
try {
|
||||||
"MC|Brand", "brand", "minecraft:brand" -> {
|
when (pluginMessage.channel) {
|
||||||
if (!VIAaaSConfig.showBrandInfo) return
|
"MC|Brand", "brand", "minecraft:brand" -> {
|
||||||
|
if (!VIAaaSConfig.showBrandInfo) return
|
||||||
|
|
||||||
val brand = "${
|
val brand = "${
|
||||||
decodeBrand(
|
decodeBrand(
|
||||||
pluginMessage.data,
|
pluginMessage.data,
|
||||||
is17(handler)
|
is17(handler)
|
||||||
)
|
)
|
||||||
}${" (VIAaaS C: ${handler.data.frontVer?.parseProtocol()} S: ${handler.data.backServerVer?.parseProtocol()})"}"
|
}${" (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