Skip to content

Commit

Permalink
copy untyped payload buffer on read/write
Browse files Browse the repository at this point in the history
closes #13

(cherry picked from commit 3e1f7e3)
  • Loading branch information
deirn committed Jan 15, 2024
1 parent a3e92de commit 48f2848
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ public static FriendlyByteBuf.Reader<UntypedPayload> reader(ResourceLocation cha

@Override
public void write(@NotNull FriendlyByteBuf buf) {
buf.writeBytes(buffer);
buf.writeBytes(buffer.copy());
}

@Override
public @NotNull ResourceLocation id() {
return channelId;
}

@Override
public FriendlyByteBuf buffer() {
return new FriendlyByteBuf(buffer.copy());
}

}

0 comments on commit 48f2848

Please sign in to comment.