Skip to content

Commit

Permalink
Set default values for InventoryContent and InventorySlot packets
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Oct 22, 2024
1 parent 0385f6b commit 67a8f2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.cloudburstmc.protocol.bedrock.data.inventory.ContainerSlotType;
import org.cloudburstmc.protocol.bedrock.data.inventory.FullContainerName;
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
import org.cloudburstmc.protocol.common.PacketSignal;
Expand All @@ -19,7 +20,7 @@ public class InventoryContentPacket implements BedrockPacket {
/**
* @since v712
*/
private FullContainerName containerNameData;
private FullContainerName containerNameData = new FullContainerName(ContainerSlotType.ANVIL_INPUT, null);
/**
* @since v729
* @deprecated since v748. Use storageItem ItemData size instead.
Expand All @@ -28,7 +29,7 @@ public class InventoryContentPacket implements BedrockPacket {
/**
* @since v748
*/
private ItemData storageItem;
private ItemData storageItem = ItemData.AIR;

@Override
public final PacketSignal handle(BedrockPacketHandler handler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.cloudburstmc.protocol.bedrock.data.inventory.ContainerSlotType;
import org.cloudburstmc.protocol.bedrock.data.inventory.FullContainerName;
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
import org.cloudburstmc.protocol.common.PacketSignal;
Expand All @@ -17,7 +18,7 @@ public class InventorySlotPacket implements BedrockPacket {
/**
* @since v712
*/
private FullContainerName containerNameData;
private FullContainerName containerNameData = new FullContainerName(ContainerSlotType.ANVIL_INPUT, null);
/**
* @since v729
* @deprecated since v748. Use storageItem ItemData size instead.
Expand All @@ -26,7 +27,7 @@ public class InventorySlotPacket implements BedrockPacket {
/**
* @since v748
*/
private ItemData storageItem;
private ItemData storageItem = ItemData.AIR;

@Override
public final PacketSignal handle(BedrockPacketHandler handler) {
Expand Down

0 comments on commit 67a8f2f

Please sign in to comment.