diff --git a/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/NetOutputStream_p340.java b/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/NetOutputStream_p340.java index ea609cf..cbc3239 100644 --- a/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/NetOutputStream_p340.java +++ b/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/NetOutputStream_p340.java @@ -14,17 +14,16 @@ import java.util.UUID; public abstract class NetOutputStream_p340 extends NetOutputStream { @Override public void writeVarInt(int value) { - do { - byte temp = (byte)(value & 0b01111111); - // Note: >>> means that the sign bit is shifted with the rest of the number rather than being left alone + while ((value & -128) != 0) { + writeByte(value & 127 | 128); value >>>= 7; - if (value != 0) { - temp |= 0b10000000; - } - writeByte(temp); - } while (value != 0); + } + + writeByte(value); } + + @Override public void writeString(String value) { if (value.length() > Short.MAX_VALUE) {