diff --git a/src/main/java/lol/bai/badpackets/impl/payload/UntypedPayload.java b/src/main/java/lol/bai/badpackets/impl/payload/UntypedPayload.java index 46b0e01..02a27a9 100644 --- a/src/main/java/lol/bai/badpackets/impl/payload/UntypedPayload.java +++ b/src/main/java/lol/bai/badpackets/impl/payload/UntypedPayload.java @@ -21,7 +21,7 @@ public static FriendlyByteBuf.Reader reader(ResourceLocation cha @Override public void write(@NotNull FriendlyByteBuf buf) { - buf.writeBytes(buffer); + buf.writeBytes(buffer.copy()); } @Override @@ -29,4 +29,9 @@ public void write(@NotNull FriendlyByteBuf buf) { return channelId; } + @Override + public FriendlyByteBuf buffer() { + return new FriendlyByteBuf(buffer.copy()); + } + }