60        $this->requestId = 
CommonTypes::readLegacyItemStackRequestId($in);
 
   61        $this->requestChangedSlots = [];
 
   62        if($this->requestId !== 0){
 
   63            for($i = 0, $len = VarInt::readUnsignedInt($in); $i < $len; ++$i){
 
   64                $this->requestChangedSlots[] = InventoryTransactionChangedSlotsHack::read($in);
 
   68        $transactionType = VarInt::readUnsignedInt($in);
 
   70        $this->trData = match($transactionType){
 
   79        $this->trData->decode($in);
 
 
   83        CommonTypes::writeLegacyItemStackRequestId($out, $this->requestId);
 
   84        if($this->requestId !== 0){
 
   85            VarInt::writeUnsignedInt($out, count($this->requestChangedSlots));
 
   86            foreach($this->requestChangedSlots as $changedSlots){
 
   87                $changedSlots->write($out);
 
   91        VarInt::writeUnsignedInt($out, $this->trData->getTypeId());
 
   93        $this->trData->encode($out);