98 string $premiumWorldTemplateId,
102 int $enchantmentSeed,
103 string $multiplayerCorrelationId,
104 bool $enableNewInventorySystem,
105 string $serverSoftwareVersion,
106 UuidInterface $worldTemplateId,
107 bool $enableClientSideChunkGeneration,
108 bool $blockNetworkIdsAreHashes,
116 $result->actorUniqueId = $actorUniqueId;
117 $result->actorRuntimeId = $actorRuntimeId;
118 $result->playerGamemode = $playerGamemode;
119 $result->playerPosition = $playerPosition;
120 $result->pitch = $pitch;
123 $result->levelSettings = $levelSettings;
124 $result->levelId = $levelId;
125 $result->worldName = $worldName;
126 $result->premiumWorldTemplateId = $premiumWorldTemplateId;
127 $result->isTrial = $isTrial;
128 $result->playerMovementSettings = $playerMovementSettings;
129 $result->currentTick = $currentTick;
130 $result->enchantmentSeed = $enchantmentSeed;
131 $result->multiplayerCorrelationId = $multiplayerCorrelationId;
132 $result->enableNewInventorySystem = $enableNewInventorySystem;
133 $result->serverSoftwareVersion = $serverSoftwareVersion;
134 $result->worldTemplateId = $worldTemplateId;
135 $result->enableClientSideChunkGeneration = $enableClientSideChunkGeneration;
136 $result->blockNetworkIdsAreHashes = $blockNetworkIdsAreHashes;
137 $result->networkPermissions = $networkPermissions;
138 $result->serverJoinInformation = $serverJoinInformation;
139 $result->serverTelemetryData = $serverTelemetryData;
140 $result->blockPalette = $blockPalette;
146 $this->actorUniqueId =
CommonTypes::getActorUniqueId($in);
147 $this->actorRuntimeId = CommonTypes::getActorRuntimeId($in);
148 $this->playerGamemode = VarInt::readSignedInt($in);
150 $this->playerPosition = CommonTypes::getVector3($in);
152 $this->pitch = LE::readFloat($in);
153 $this->yaw = LE::readFloat($in);
155 $this->levelSettings = LevelSettings::read($in);
157 $this->levelId = CommonTypes::getString($in);
158 $this->worldName = CommonTypes::getString($in);
159 $this->premiumWorldTemplateId = CommonTypes::getString($in);
160 $this->isTrial = CommonTypes::getBool($in);
161 $this->playerMovementSettings = PlayerMovementSettings::read($in);
162 $this->currentTick = LE::readUnsignedLong($in);
164 $this->enchantmentSeed = VarInt::readSignedInt($in);
166 $this->blockPalette = [];
167 for($i = 0, $len = VarInt::readUnsignedInt($in); $i < $len; ++$i){
168 $blockName = CommonTypes::getString($in);
169 $state = CommonTypes::getNbtCompoundRoot($in);
173 $this->multiplayerCorrelationId = CommonTypes::getString($in);
174 $this->enableNewInventorySystem = CommonTypes::getBool($in);
175 $this->serverSoftwareVersion = CommonTypes::getString($in);
176 $this->playerActorProperties =
new CacheableNbt(CommonTypes::getNbtCompoundRoot($in));
177 $this->blockPaletteChecksum = LE::readUnsignedLong($in);
178 $this->worldTemplateId = CommonTypes::getUUID($in);
179 $this->enableClientSideChunkGeneration = CommonTypes::getBool($in);
180 $this->blockNetworkIdsAreHashes = CommonTypes::getBool($in);
181 $this->networkPermissions = NetworkPermissions::decode($in);
182 $this->serverJoinInformation = CommonTypes::readOptional($in, ServerJoinInformation::read(...));
183 $this->serverTelemetryData = ServerTelemetryData::read($in);
187 CommonTypes::putActorUniqueId($out, $this->actorUniqueId);
188 CommonTypes::putActorRuntimeId($out, $this->actorRuntimeId);
189 VarInt::writeSignedInt($out, $this->playerGamemode);
191 CommonTypes::putVector3($out, $this->playerPosition);
193 LE::writeFloat($out, $this->pitch);
194 LE::writeFloat($out, $this->yaw);
196 $this->levelSettings->write($out);
198 CommonTypes::putString($out, $this->levelId);
199 CommonTypes::putString($out, $this->worldName);
200 CommonTypes::putString($out, $this->premiumWorldTemplateId);
201 CommonTypes::putBool($out, $this->isTrial);
202 $this->playerMovementSettings->write($out);
203 LE::writeUnsignedLong($out, $this->currentTick);
205 VarInt::writeSignedInt($out, $this->enchantmentSeed);
207 VarInt::writeUnsignedInt($out, count($this->blockPalette));
208 foreach($this->blockPalette as $entry){
209 CommonTypes::putString($out, $entry->getName());
210 $out->writeByteArray($entry->getStates()->getEncodedNbt());
213 CommonTypes::putString($out, $this->multiplayerCorrelationId);
214 CommonTypes::putBool($out, $this->enableNewInventorySystem);
215 CommonTypes::putString($out, $this->serverSoftwareVersion);
216 $out->writeByteArray($this->playerActorProperties->getEncodedNbt());
217 LE::writeUnsignedLong($out, $this->blockPaletteChecksum);
218 CommonTypes::putUUID($out, $this->worldTemplateId);
219 CommonTypes::putBool($out, $this->enableClientSideChunkGeneration);
220 CommonTypes::putBool($out, $this->blockNetworkIdsAreHashes);
221 $this->networkPermissions->encode($out);
222 CommonTypes::writeOptional($out, $this->serverJoinInformation, fn(ByteBufferWriter $out,
ServerJoinInformation $info) => $info->write($out));
223 $this->serverTelemetryData->write($out);