Skip to content

Commit

Permalink
Debug read all the data
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Dec 9, 2024
1 parent 41f09c6 commit 5c27c5e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.util.Identifier;

import java.nio.charset.StandardCharsets;

public record BungeeCordPayload(byte[] data) implements CustomPayload {
public static final CustomPayload.Id<BungeeCordPayload> ID = new CustomPayload.Id<>(Identifier.of("bungeecord", "main"));

Expand All @@ -22,6 +24,9 @@ public CustomPayload.Id<BungeeCordPayload> getId() {
}

private static BungeeCordPayload read(ByteBuf buf) {
return new BungeeCordPayload(PacketByteBuf.readByteArray(buf));
var data = PacketByteBuf.readByteArray(buf);
// debug
System.out.println(new String(data, StandardCharsets.UTF_8));
return new BungeeCordPayload(data);
}
}

0 comments on commit 5c27c5e

Please sign in to comment.