From 9e4c7c7408378afb60c740f9dbe9afa1aa424e47 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Sun, 3 Nov 2024 22:43:27 +0800 Subject: [PATCH] Fix neoforge Velocity support (#1445) --- .../login/ServerboundCustomQueryAnswerPacketMixin_Forge.java | 2 +- .../login/ServerboundCustomQueryAnswerPacketMixin_NeoForge.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arclight-forge/src/main/java/io/izzel/arclight/forge/mixin/core/network/protocol/login/ServerboundCustomQueryAnswerPacketMixin_Forge.java b/arclight-forge/src/main/java/io/izzel/arclight/forge/mixin/core/network/protocol/login/ServerboundCustomQueryAnswerPacketMixin_Forge.java index 5b3f856fb..047fbb7a1 100644 --- a/arclight-forge/src/main/java/io/izzel/arclight/forge/mixin/core/network/protocol/login/ServerboundCustomQueryAnswerPacketMixin_Forge.java +++ b/arclight-forge/src/main/java/io/izzel/arclight/forge/mixin/core/network/protocol/login/ServerboundCustomQueryAnswerPacketMixin_Forge.java @@ -29,7 +29,7 @@ private static void readResponse(int id, FriendlyByteBuf buf, CallbackInfoReturn if (i >= 0 && i < MAX_PAYLOAD_SIZE) { var payload = Unpooled.buffer(i); buf.readBytes(payload); - cir.setReturnValue(new ArclightCustomQueryAnswerPayload(payload)); + cir.setReturnValue(new ArclightCustomQueryAnswerPayload(Unpooled.wrappedBuffer(Unpooled.copyBoolean(true), payload))); } else { throw new IllegalArgumentException("Payload may not be larger than 1048576 bytes"); } diff --git a/arclight-neoforge/src/main/java/io/izzel/arclight/neoforge/mixin/core/network/protocol/login/ServerboundCustomQueryAnswerPacketMixin_NeoForge.java b/arclight-neoforge/src/main/java/io/izzel/arclight/neoforge/mixin/core/network/protocol/login/ServerboundCustomQueryAnswerPacketMixin_NeoForge.java index 0521ee69e..7df943511 100644 --- a/arclight-neoforge/src/main/java/io/izzel/arclight/neoforge/mixin/core/network/protocol/login/ServerboundCustomQueryAnswerPacketMixin_NeoForge.java +++ b/arclight-neoforge/src/main/java/io/izzel/arclight/neoforge/mixin/core/network/protocol/login/ServerboundCustomQueryAnswerPacketMixin_NeoForge.java @@ -29,7 +29,7 @@ private static void readResponse(int id, FriendlyByteBuf buf, CallbackInfoReturn if (i >= 0 && i < MAX_PAYLOAD_SIZE) { var payload = Unpooled.buffer(i); buf.readBytes(payload); - cir.setReturnValue(new ArclightCustomQueryAnswerPayload(payload)); + cir.setReturnValue(new ArclightCustomQueryAnswerPayload(Unpooled.wrappedBuffer(Unpooled.copyBoolean(true), payload))); } else { throw new IllegalArgumentException("Payload may not be larger than 1048576 bytes"); }