From c519b66bd6753999766f3ee88f834912ba30d903 Mon Sep 17 00:00:00 2001 From: deirn Date: Fri, 12 Apr 2024 23:02:28 +0700 Subject: [PATCH] use registry buf to send play c2s mc:register packet --- .../bai/badpackets/impl/handler/ClientPlayPacketHandler.java | 2 +- .../java/lol/bai/badpackets/impl/platform/PlatformProxy.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/lol/bai/badpackets/impl/handler/ClientPlayPacketHandler.java b/src/main/java/lol/bai/badpackets/impl/handler/ClientPlayPacketHandler.java index fe52479..1e3ce49 100644 --- a/src/main/java/lol/bai/badpackets/impl/handler/ClientPlayPacketHandler.java +++ b/src/main/java/lol/bai/badpackets/impl/handler/ClientPlayPacketHandler.java @@ -40,7 +40,7 @@ public static ClientPlayPacketHandler get() { @Override protected Packet createVanillaRegisterPacket(Set channels, Consumer buf) { - return PlatformProxy.INSTANCE.createVanillaRegisterPlayC2SPacket(channels, buf); + return PlatformProxy.INSTANCE.createVanillaRegisterPlayC2SPacket(listener.registryAccess(), channels, buf); } @Override diff --git a/src/main/java/lol/bai/badpackets/impl/platform/PlatformProxy.java b/src/main/java/lol/bai/badpackets/impl/platform/PlatformProxy.java index 42fcc90..35c81f1 100644 --- a/src/main/java/lol/bai/badpackets/impl/platform/PlatformProxy.java +++ b/src/main/java/lol/bai/badpackets/impl/platform/PlatformProxy.java @@ -39,8 +39,8 @@ public Packet createVanillaRegisterConfigS2CPacket(Set chan return ClientboundCustomPayloadPacket.CONFIG_STREAM_CODEC.decode(createBuf(null, writer)); } - public Packet createVanillaRegisterPlayC2SPacket(Set channels, Consumer writer) { - return ServerboundCustomPayloadPacket.STREAM_CODEC.decode(createBuf(null, writer)); + public Packet createVanillaRegisterPlayC2SPacket(RegistryAccess registry, Set channels, Consumer writer) { + return ServerboundCustomPayloadPacket.STREAM_CODEC.decode(createBuf(registry, writer)); } public Packet createVanillaRegisterPlayS2CPacket(RegistryAccess registry, Set channels, Consumer writer) {