mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-11-14 19:34:58 -05:00
Fix some item decoding errors
This commit is contained in:
parent
36d9415992
commit
2a7176f7ee
2 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue