Archived
0

избавляемся от странного кода

This commit is contained in:
2019-01-27 01:05:51 +03:00
parent 5dad2242b6
commit 0a833fb715
4 changed files with 20 additions and 12 deletions

View File

@@ -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;
}