26 public const NETWORK_ID = ProtocolInfo::SET_PLAYER_INVENTORY_OPTIONS_PACKET;
28 private InventoryLeftTab $leftTab;
29 private InventoryRightTab $rightTab;
30 private bool $filtering;
31 private InventoryLayout $inventoryLayout;
32 private InventoryLayout $craftingLayout;
37 public static function create(InventoryLeftTab $leftTab, InventoryRightTab $rightTab,
bool $filtering, InventoryLayout $inventoryLayout, InventoryLayout $craftingLayout) : self{
39 $result->leftTab = $leftTab;
40 $result->rightTab = $rightTab;
41 $result->filtering = $filtering;
42 $result->inventoryLayout = $inventoryLayout;
43 $result->craftingLayout = $craftingLayout;
47 public function getLeftTab() : InventoryLeftTab{ return $this->leftTab; }
49 public function getRightTab() : InventoryRightTab{ return $this->rightTab; }
51 public function isFiltering() : bool{ return $this->filtering; }
53 public function getInventoryLayout() : InventoryLayout{ return $this->inventoryLayout; }
55 public function getCraftingLayout() : InventoryLayout{ return $this->craftingLayout; }
58 $this->leftTab = InventoryLeftTab::fromPacket(VarInt::readSignedInt($in));
59 $this->rightTab = InventoryRightTab::fromPacket(VarInt::readSignedInt($in));
60 $this->filtering = CommonTypes::getBool($in);
61 $this->inventoryLayout = InventoryLayout::fromPacket(VarInt::readSignedInt($in));
62 $this->craftingLayout = InventoryLayout::fromPacket(VarInt::readSignedInt($in));
66 VarInt::writeSignedInt($out, $this->leftTab->value);
67 VarInt::writeSignedInt($out, $this->rightTab->value);
68 CommonTypes::putBool($out, $this->filtering);
69 VarInt::writeSignedInt($out, $this->inventoryLayout->value);
70 VarInt::writeSignedInt($out, $this->craftingLayout->value);
74 return $handler->handleSetPlayerInventoryOptions($this);