29 private int $requestId,
30 private array $actions,
31 private array $filterStrings,
32 private int $filterStringCause
35 public function getRequestId() : int{ return $this->requestId; }
38 public function getActions() : array{ return $this->actions; }
46 public function getFilterStringCause() : int{ return $this->filterStringCause; }
52 private static function readAction(
PacketSerializer $in,
int $typeId) : ItemStackRequestAction{
53 return match($typeId){
54 TakeStackRequestAction::ID => TakeStackRequestAction::read($in),
55 PlaceStackRequestAction::ID => PlaceStackRequestAction::read($in),
56 SwapStackRequestAction::ID => SwapStackRequestAction::read($in),
57 DropStackRequestAction::ID => DropStackRequestAction::read($in),
58 DestroyStackRequestAction::ID => DestroyStackRequestAction::read($in),
59 CraftingConsumeInputStackRequestAction::ID => CraftingConsumeInputStackRequestAction::read($in),
60 CraftingCreateSpecificResultStackRequestAction::ID => CraftingCreateSpecificResultStackRequestAction::read($in),
61 LabTableCombineStackRequestAction::ID => LabTableCombineStackRequestAction::read($in),
62 BeaconPaymentStackRequestAction::ID => BeaconPaymentStackRequestAction::read($in),
63 MineBlockStackRequestAction::ID => MineBlockStackRequestAction::read($in),
64 CraftRecipeStackRequestAction::ID => CraftRecipeStackRequestAction::read($in),
65 CraftRecipeAutoStackRequestAction::ID => CraftRecipeAutoStackRequestAction::read($in),
66 CreativeCreateStackRequestAction::ID => CreativeCreateStackRequestAction::read($in),
67 CraftRecipeOptionalStackRequestAction::ID => CraftRecipeOptionalStackRequestAction::read($in),
68 GrindstoneStackRequestAction::ID => GrindstoneStackRequestAction::read($in),
69 LoomStackRequestAction::ID => LoomStackRequestAction::read($in),
70 DeprecatedCraftingNonImplementedStackRequestAction::ID => DeprecatedCraftingNonImplementedStackRequestAction::read($in),
71 DeprecatedCraftingResultsStackRequestAction::ID => DeprecatedCraftingResultsStackRequestAction::read($in),
77 $requestId = $in->readItemStackRequestId();
80 $typeId = $in->getByte();
81 $actions[] = self::readAction($in, $typeId);
85 $filterStrings[] = $in->getString();
87 $filterStringCause = $in->
getLInt();
88 return new self($requestId, $actions, $filterStrings, $filterStringCause);
92 $out->writeItemStackRequestId($this->requestId);
94 foreach($this->actions as $action){
95 $out->putByte($action->getTypeId());
99 foreach($this->filterStrings as $string){
100 $out->putString($string);
102 $out->putLInt($this->filterStringCause);