From 01e2c43b5d1aaaec318b3fdb81a061aa1338ee9d Mon Sep 17 00:00:00 2001 From: Huynh Tien Date: Sat, 29 Oct 2022 17:06:18 +0700 Subject: [PATCH] try fixing EOF on ClientClick (#1490) --- .../net/minestom/server/network/NetworkBufferTypes.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/network/NetworkBufferTypes.java b/src/main/java/net/minestom/server/network/NetworkBufferTypes.java index aedcfd8af..f84e68858 100644 --- a/src/main/java/net/minestom/server/network/NetworkBufferTypes.java +++ b/src/main/java/net/minestom/server/network/NetworkBufferTypes.java @@ -242,7 +242,12 @@ final class NetworkBufferTypes { nbtReader = new NBTReader(new InputStream() { @Override public int read() { - return buffer.read(BYTE); + return buffer.read(BYTE) & 0xFF; + } + + @Override + public int available() { + return buffer.readableBytes(); } }, CompressedProcesser.NONE); buffer.nbtReader = nbtReader;