mirror of
https://github.com/ViaVersion/ViaLegacy.git
synced 2025-03-01 03:52:01 +01:00
Fixed NPE if container has no items tag
This commit is contained in:
parent
cdfa1a5a10
commit
3b47d46548
@ -364,10 +364,12 @@ 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) {
|
private void readItemsFromTag(final CompoundTag tag, final Item[] items) {
|
||||||
final ListTag<CompoundTag> itemList = tag.getListTag("Items", CompoundTag.class);
|
final ListTag<CompoundTag> itemList = tag.getListTag("Items", CompoundTag.class);
|
||||||
|
if (itemList != null) {
|
||||||
for (CompoundTag itemTag : itemList) {
|
for (CompoundTag itemTag : itemList) {
|
||||||
items[itemTag.getByte("Slot") & 255] = new DataItem(itemTag.getShort("id"), itemTag.getByte("Count"), itemTag.getShort("Damage"), null);
|
items[itemTag.getByte("Slot") & 255] = new DataItem(itemTag.getShort("id"), itemTag.getByte("Count"), itemTag.getShort("Damage"), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void sendWindowItems(final UserConnection user, final byte windowId, final Item[] items) {
|
private void sendWindowItems(final UserConnection user, final byte windowId, final Item[] items) {
|
||||||
final PacketWrapper windowItems = PacketWrapper.create(ClientboundPacketsb1_1.CONTAINER_SET_CONTENT, user);
|
final PacketWrapper windowItems = PacketWrapper.create(ClientboundPacketsb1_1.CONTAINER_SET_CONTENT, user);
|
||||||
|
Loading…
Reference in New Issue
Block a user