add support for decoding item profile properties from NBT lists, fix #1377
This commit is contained in:
1 parent
7225117fea
commit
0d030d0ca7
1 file changed
+9
+9
@@ -21,6 +21,7 @@ package com.github.retrooper.packetevents.protocol.component.builtin.item;
|
||||
import com.github.retrooper.packetevents.manager.server.ServerVersion;
|
||||
import com.github.retrooper.packetevents.protocol.nbt.NBT;
|
||||
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
|
||||
import com.github.retrooper.packetevents.protocol.nbt.NBTList;
|
||||
import com.github.retrooper.packetevents.protocol.nbt.NBTString;
|
||||
import com.github.retrooper.packetevents.protocol.player.PlayerModelType;
|
||||
import com.github.retrooper.packetevents.protocol.util.NbtCodec;
|
||||
@@ -256,6 +257,14 @@ public final class ItemProfile {
|
||||
}
|
||||
}
|
||||
return properties;
|
||||
} else if (nbt instanceof NBTList<?>) {
|
||||
NBTList<?> listTag = (NBTList<?>) nbt;
|
||||
List<ItemProfile.Property> properties = new ArrayList<>(listTag.size());
|
||||
for (NBT nbtElement : listTag.getTags()) {
|
||||
ItemProfile.Property property = CODEC.decode(nbtElement, wrapper);
|
||||
properties.add(property);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
return this.propertyList.decode(nbt, wrapper);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user