From c4b51b0e7eeb6b09fa51651bb59c864788bc1ba3 Mon Sep 17 00:00:00 2001 From: Moulberry Date: Wed, 6 Mar 2024 16:21:27 +0800 Subject: [PATCH] Adapt version util for 1.20.1 --- src/main/java/com/moulberry/axiom/VersionHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/moulberry/axiom/VersionHelper.java b/src/main/java/com/moulberry/axiom/VersionHelper.java index 2729968..2c3992c 100644 --- a/src/main/java/com/moulberry/axiom/VersionHelper.java +++ b/src/main/java/com/moulberry/axiom/VersionHelper.java @@ -1,14 +1,15 @@ package com.moulberry.axiom; -import com.moulberry.axiom.packet.CustomByteArrayPayload; -import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket; +import io.netty.buffer.Unpooled; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; public class VersionHelper { public static void sendCustomPayload(ServerPlayer serverPlayer, ResourceLocation id, byte[] data) { - serverPlayer.connection.send(new ClientboundCustomPayloadPacket(new CustomByteArrayPayload(id, data))); + serverPlayer.connection.send(new ClientboundCustomPayloadPacket(id, new FriendlyByteBuf(Unpooled.wrappedBuffer(data)))); } }