26 public const NETWORK_ID = ProtocolInfo::CLIENTBOUND_TEXTURE_SHIFT_PACKET;
29 private int $actionId;
30 private string $collectionName;
31 private string $fromStep;
32 private string $toStep;
37 private array $allSteps;
38 private int $currentLengthTicks;
39 private int $totalLengthTicks;
40 private bool $enabled;
49 string $collectionName,
53 int $currentLengthTicks,
54 int $totalLengthTicks,
58 $result->actionId = $actionId;
59 $result->collectionName = $collectionName;
60 $result->fromStep = $fromStep;
61 $result->toStep = $toStep;
62 $result->allSteps = $allSteps;
63 $result->currentLengthTicks = $currentLengthTicks;
64 $result->totalLengthTicks = $totalLengthTicks;
65 $result->enabled = $enabled;
72 public function getActionId() : int{ return $this->actionId; }
74 public function getCollectionName() : string{ return $this->collectionName; }
76 public function getFromStep() : string{ return $this->fromStep; }
78 public function getToStep() : string{ return $this->toStep; }
84 public function getAllSteps() : array{ return $this->allSteps; }
86 public function getCurrentLengthTicks() : int{ return $this->currentLengthTicks; }
88 public function getTotalLengthTicks() : int{ return $this->totalLengthTicks; }
90 public function isEnabled() : bool{ return $this->enabled; }
93 $this->actionId = Byte::readUnsigned($in);
94 $this->collectionName = CommonTypes::getString($in);
95 $this->fromStep = CommonTypes::getString($in);
96 $this->toStep = CommonTypes::getString($in);
98 for($i = 0, $count = VarInt::readUnsignedInt($in); $i < $count; ++$i){
99 $this->allSteps[] = CommonTypes::getString($in);
102 $this->currentLengthTicks = VarInt::readUnsignedLong($in);
103 $this->totalLengthTicks = VarInt::readUnsignedLong($in);
104 $this->enabled = CommonTypes::getBool($in);
108 Byte::writeUnsigned($out, $this->actionId);
109 CommonTypes::putString($out, $this->collectionName);
110 CommonTypes::putString($out, $this->fromStep);
111 CommonTypes::putString($out, $this->toStep);
113 VarInt::writeUnsignedInt($out, count($this->allSteps));
114 foreach($this->allSteps as $step){
115 CommonTypes::putString($out, $step);
118 VarInt::writeUnsignedLong($out, $this->currentLengthTicks);
119 VarInt::writeUnsignedLong($out, $this->totalLengthTicks);
120 CommonTypes::putBool($out, $this->enabled);
124 return $handler->handleClientboundTextureShift($this);
handle(PacketHandlerInterface $handler)
static create(int $actionId, string $collectionName, string $fromStep, string $toStep, array $allSteps, int $currentLengthTicks, int $totalLengthTicks, bool $enabled,)