From a6b304abcebe8223d113a27ff385e412c7a4f5e6 Mon Sep 17 00:00:00 2001 From: Daniel Orr Date: Mon, 16 Dec 2024 19:10:48 +0000 Subject: [PATCH 1/3] chore: .gitignore changes --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c476faf..d6eacb1 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ hs_err_*.log replay_*.log *.hprof *.jfr +.kotlin From a99c595fbb100f7fac342352e0f3324f52dff6a5 Mon Sep 17 00:00:00 2001 From: Daniel Orr Date: Mon, 16 Dec 2024 19:23:08 +0000 Subject: [PATCH 2/3] fix: do not respond when resource pack unavailable --- build.gradle | 4 ++-- gradle.properties | 2 +- .../audience/resource/ResourcePackInjectHandler.kt | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 25e3e21..7e7d1ea 100644 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,8 @@ base { repositories { maven { - name = "Andante" - url = "https://maven.andante.dev/releases/" + name = "MC Brawls Maven" + url = "https://maven.mcbrawls.net/releases/" } } diff --git a/gradle.properties b/gradle.properties index 43db466..71b4581 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ kotlin_version=2.0.21 fabric_kotlin_version=1.12.3 # mod properties -mod_version=3.2.1 +mod_version=3.2.2 maven_group=net.mcbrawls mod_id=audience diff --git a/src/main/kotlin/dev/andante/audience/resource/ResourcePackInjectHandler.kt b/src/main/kotlin/dev/andante/audience/resource/ResourcePackInjectHandler.kt index ba249ec..e396216 100644 --- a/src/main/kotlin/dev/andante/audience/resource/ResourcePackInjectHandler.kt +++ b/src/main/kotlin/dev/andante/audience/resource/ResourcePackInjectHandler.kt @@ -9,16 +9,15 @@ import net.mcbrawls.inject.http.HttpRequest object ResourcePackInjectHandler : HttpInjector() { private val resourcePacks: MutableMap = mutableMapOf() - override fun intercept(ctx: ChannelHandlerContext, request: HttpRequest): HttpByteBuf { - val response = httpBuf(ctx) - + override fun intercept(ctx: ChannelHandlerContext, request: HttpRequest): HttpByteBuf? { val path = request.requestURI.removePrefix("/") - val pack = resourcePacks[path] ?: return response + val pack = resourcePacks[path] ?: return null if (!ctx.channel().isActive) { - return response + return null } + val response = httpBuf(ctx) response.writeStatusLine("1.1", 200, "OK") response.writeHeader("Content-Type", "application/zip") response.writeHeader("Content-Length", pack.size.toString()) From f2cead3eb35c05006214006643cbc8a71fdd38fc Mon Sep 17 00:00:00 2001 From: Daniel Orr Date: Mon, 16 Dec 2024 19:31:28 +0000 Subject: [PATCH 3/3] chore: update inject (^3.0.1) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 71b4581..fc7a103 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,4 +22,4 @@ mod_id=audience # dependencies kache_version=1.0.5 -inject_version=3.0.0 +inject_version=3.0.1