избавляемся от странного кода
This commit is contained in:
@@ -9,11 +9,12 @@ import mc.core.network.NetInputStream;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@Slf4j
|
||||
public abstract class NetInputStream_p340 extends NetInputStream {
|
||||
@Override
|
||||
public int readVarInt(int[] countReadBytes) {
|
||||
public int readVarInt(AtomicInteger countReadBytes) {
|
||||
int numRead = 0;
|
||||
int result = 0;
|
||||
byte read;
|
||||
@@ -29,7 +30,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