diff --git a/common/src/main/java/com/viaversion/viaversion/connection/UserConnectionImpl.java b/common/src/main/java/com/viaversion/viaversion/connection/UserConnectionImpl.java index 35f4b9ab0..7f1f645e0 100644 --- a/common/src/main/java/com/viaversion/viaversion/connection/UserConnectionImpl.java +++ b/common/src/main/java/com/viaversion/viaversion/connection/UserConnectionImpl.java @@ -373,7 +373,7 @@ public class UserConnectionImpl implements UserConnection { // Instead of allocating a possible unnecessarily large buffer to write the wrapper contents to, // only allocate the remaining bytes and write the rest to the original buf's head directly. - final ByteBuf remainingBuf = buf.alloc().buffer(remainingBytes); + final ByteBuf remainingBuf = buf.alloc().buffer(remainingBytes, remainingBytes); try { // Copy before modifying the buffer remainingBuf.writeBytes(buf, remainingBytes);