23 public const NETWORK_ID = ProtocolInfo::SET_PLAYER_INVENTORY_OPTIONS_PACKET;
25 private InventoryLeftTab $leftTab;
26 private InventoryRightTab $rightTab;
27 private bool $filtering;
28 private InventoryLayout $inventoryLayout;
29 private InventoryLayout $craftingLayout;
34 public static function create(InventoryLeftTab $leftTab, InventoryRightTab $rightTab,
bool $filtering, InventoryLayout $inventoryLayout, InventoryLayout $craftingLayout) : self{
36 $result->leftTab = $leftTab;
37 $result->rightTab = $rightTab;
38 $result->filtering = $filtering;
39 $result->inventoryLayout = $inventoryLayout;
40 $result->craftingLayout = $craftingLayout;
44 public function getLeftTab() : InventoryLeftTab{ return $this->leftTab; }
46 public function getRightTab() : InventoryRightTab{ return $this->rightTab; }
48 public function isFiltering() : bool{ return $this->filtering; }
50 public function getInventoryLayout() : InventoryLayout{ return $this->inventoryLayout; }
52 public function getCraftingLayout() : InventoryLayout{ return $this->craftingLayout; }
55 $this->leftTab = InventoryLeftTab::fromPacket($in->getVarInt());
56 $this->rightTab = InventoryRightTab::fromPacket($in->
getVarInt());
57 $this->filtering = $in->
getBool();
58 $this->inventoryLayout = InventoryLayout::fromPacket($in->
getVarInt());
59 $this->craftingLayout = InventoryLayout::fromPacket($in->
getVarInt());
63 $out->putVarInt($this->leftTab->value);
65 $out->putBool($this->filtering);
66 $out->
putVarInt($this->inventoryLayout->value);
67 $out->
putVarInt($this->craftingLayout->value);
71 return $handler->handleSetPlayerInventoryOptions($this);