mirror of
https://github.com/ViaVersion/ViaLegacy.git
synced 2025-01-30 23:03:03 +01:00
Fixed NPE if container has no items tag
This commit is contained in:
parent
cdfa1a5a10
commit
3b47d46548
@ -364,8 +364,10 @@ public class Protocola1_2_3_5_1_2_6Tob1_0_1_1_1 extends StatelessProtocol<Client
|
||||
|
||||
private void readItemsFromTag(final CompoundTag tag, final Item[] items) {
|
||||
final ListTag<CompoundTag> itemList = tag.getListTag("Items", CompoundTag.class);
|
||||
for (CompoundTag itemTag : itemList) {
|
||||
items[itemTag.getByte("Slot") & 255] = new DataItem(itemTag.getShort("id"), itemTag.getByte("Count"), itemTag.getShort("Damage"), null);
|
||||
if (itemList != null) {
|
||||
for (CompoundTag itemTag : itemList) {
|
||||
items[itemTag.getByte("Slot") & 255] = new DataItem(itemTag.getShort("id"), itemTag.getByte("Count"), itemTag.getShort("Damage"), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user