From 9dec1c406fad60ee6e8ecb1630a923780c5e9a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Kr=C3=BCger?= Date: Thu, 17 Oct 2024 21:42:58 +0200 Subject: [PATCH] fix: isRelevant never getting called, oops fuck --- gradle.properties | 2 +- src/main/kotlin/net/mcbrawls/inject/Injector.kt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5110ff1..4503d27 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ yarn_mappings=1.21.1+build.3 loader_version=0.16.7 kotlin_loader_version=1.12.3+kotlin.2.0.21 # Mod Properties -mod_version=1.0 +mod_version=1.1 maven_group=net.mcbrawls archives_base_name=inject # Dependencies diff --git a/src/main/kotlin/net/mcbrawls/inject/Injector.kt b/src/main/kotlin/net/mcbrawls/inject/Injector.kt index f56efa3..bffdd91 100644 --- a/src/main/kotlin/net/mcbrawls/inject/Injector.kt +++ b/src/main/kotlin/net/mcbrawls/inject/Injector.kt @@ -28,6 +28,12 @@ abstract class Injector : ChannelDuplexHandler() { override fun channelRead(ctx: ChannelHandlerContext, msg: Any) { val buf = msg as ByteBuf + val context = InjectorContext(ctx.pipeline(), buf) + if (!isRelevant(context)) { + super.channelRead(ctx, msg) + return + } + val shouldDelegate = !onRead(ctx, buf) if (shouldDelegate) super.channelRead(ctx, msg)