Fix some item decoding errors

This commit is contained in:
Camotoy 2024-04-21 16:10:10 -04:00
parent 36d9415992
commit 2a7176f7ee
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
2 changed files with 3 additions and 2 deletions

View file

@ -269,7 +269,7 @@ public class MinecraftCodecHelper extends BasePacketCodecHelper {
public DataComponents readDataComponentPatch(ByteBuf buf) throws IOException {
int nonNullComponents = this.readVarInt(buf);
int nullComponents = this.readVarInt(buf);
if (nonNullComponents == 0 & nullComponents == 0) {
if (nonNullComponents == 0 && nullComponents == 0) {
return null;
}

View file

@ -140,7 +140,8 @@ public class DataComponentType<T> {
private static <T> Reader<List<T>> listReader(Reader<T> reader) {
return (helper, input) -> {
List<T> ret = new ArrayList<>();
for (int i = 0; i < helper.readVarInt(input); i++) {
int size = helper.readVarInt(input);
for (int i = 0; i < size; i++) {
ret.add(reader.read(helper, input));
}