Skip to content

Commit

Permalink
Add null check for DynamicID too
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Sep 16, 2024
1 parent b315ef6 commit a1c841c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class InventoryContentSerializer_v712 extends InventoryContentSerializer_
@Override
public void serialize(ByteBuf buffer, BedrockCodecHelper helper, InventoryContentPacket packet) {
super.serialize(buffer, helper, packet);
VarInts.writeUnsignedInt(buffer, packet.getContainerNameData() == null ? 0 : packet.getContainerNameData().getDynamicId());
VarInts.writeUnsignedInt(buffer, packet.getContainerNameData() == null || packet.getContainerNameData().getDynamicId() == null ? 0 : packet.getContainerNameData().getDynamicId());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class InventorySlotSerializer_v712 implements BedrockPacketSerializer<Inv
public void serialize(ByteBuf buffer, BedrockCodecHelper helper, InventorySlotPacket packet) {
VarInts.writeUnsignedInt(buffer, packet.getContainerId());
VarInts.writeUnsignedInt(buffer, packet.getSlot());
VarInts.writeUnsignedInt(buffer, packet.getContainerNameData() == null ? 0 : packet.getContainerNameData().getDynamicId());
VarInts.writeUnsignedInt(buffer, packet.getContainerNameData() == null || packet.getContainerNameData().getDynamicId() == null ? 0 : packet.getContainerNameData().getDynamicId());
helper.writeNetItem(buffer, packet.getItem());
}

Expand Down

0 comments on commit a1c841c

Please sign in to comment.