Merge branch 'proto_1.12.2' into world-loader-anvil
# Conflicts: # proto_1.12.2_netty/src/main/java/mc/core/network/proto_1_12_2/netty/PacketEncoder.java
This commit is contained in:
@@ -8,13 +8,14 @@ import mc.core.network.NetInputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@Slf4j
|
||||
public abstract class NetInputStream_p340 extends NetInputStream {
|
||||
private NBTInputStream nbtInputStream;
|
||||
|
||||
@Override
|
||||
public int readVarInt(int[] countReadBytes) {
|
||||
public int readVarInt(AtomicInteger countReadBytes) {
|
||||
int numRead = 0;
|
||||
int result = 0;
|
||||
byte read;
|
||||
@@ -30,7 +31,10 @@ public abstract class NetInputStream_p340 extends NetInputStream {
|
||||
numRead++;
|
||||
} while ((read & 0b10000000) != 0);
|
||||
|
||||
if (countReadBytes != null && countReadBytes.length == 1) countReadBytes[0] = numRead;
|
||||
if (countReadBytes != null) {
|
||||
countReadBytes.set(numRead);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user