99 string $premiumWorldTemplateId,
103 int $enchantmentSeed,
104 string $multiplayerCorrelationId,
105 bool $enableNewInventorySystem,
106 string $serverSoftwareVersion,
107 UuidInterface $worldTemplateId,
108 bool $enableClientSideChunkGeneration,
109 bool $blockNetworkIdsAreHashes,
118 $result->actorUniqueId = $actorUniqueId;
119 $result->actorRuntimeId = $actorRuntimeId;
120 $result->playerGamemode = $playerGamemode;
121 $result->playerPosition = $playerPosition;
122 $result->pitch = $pitch;
125 $result->levelSettings = $levelSettings;
126 $result->levelId = $levelId;
127 $result->worldName = $worldName;
128 $result->premiumWorldTemplateId = $premiumWorldTemplateId;
129 $result->isTrial = $isTrial;
130 $result->playerMovementSettings = $playerMovementSettings;
131 $result->currentTick = $currentTick;
132 $result->enchantmentSeed = $enchantmentSeed;
133 $result->multiplayerCorrelationId = $multiplayerCorrelationId;
134 $result->enableNewInventorySystem = $enableNewInventorySystem;
135 $result->serverSoftwareVersion = $serverSoftwareVersion;
136 $result->worldTemplateId = $worldTemplateId;
137 $result->enableClientSideChunkGeneration = $enableClientSideChunkGeneration;
138 $result->blockNetworkIdsAreHashes = $blockNetworkIdsAreHashes;
139 $result->networkPermissions = $networkPermissions;
140 $result->isLoggingChat = $isLoggingChat;
141 $result->serverJoinInformation = $serverJoinInformation;
142 $result->serverTelemetryData = $serverTelemetryData;
143 $result->blockPalette = $blockPalette;
149 $this->actorUniqueId =
CommonTypes::getActorUniqueId($in);
150 $this->actorRuntimeId = CommonTypes::getActorRuntimeId($in);
151 $this->playerGamemode = VarInt::readSignedInt($in);
153 $this->playerPosition = CommonTypes::getVector3($in);
155 $this->pitch = LE::readFloat($in);
156 $this->yaw = LE::readFloat($in);
158 $this->levelSettings = LevelSettings::read($in);
160 $this->levelId = CommonTypes::getString($in);
161 $this->worldName = CommonTypes::getString($in);
162 $this->premiumWorldTemplateId = CommonTypes::getString($in);
163 $this->isTrial = CommonTypes::getBool($in);
164 $this->playerMovementSettings = PlayerMovementSettings::read($in);
165 $this->currentTick = LE::readUnsignedLong($in);
167 $this->enchantmentSeed = VarInt::readSignedInt($in);
169 $this->blockPalette = [];
170 for($i = 0, $len = VarInt::readUnsignedInt($in); $i < $len; ++$i){
171 $blockName = CommonTypes::getString($in);
172 $state = CommonTypes::getNbtCompoundRoot($in);
176 $this->multiplayerCorrelationId = CommonTypes::getString($in);
177 $this->enableNewInventorySystem = CommonTypes::getBool($in);
178 $this->serverSoftwareVersion = CommonTypes::getString($in);
179 $this->playerActorProperties =
new CacheableNbt(CommonTypes::getNbtCompoundRoot($in));
180 $this->blockPaletteChecksum = LE::readUnsignedLong($in);
181 $this->worldTemplateId = CommonTypes::getUUID($in);
182 $this->enableClientSideChunkGeneration = CommonTypes::getBool($in);
183 $this->blockNetworkIdsAreHashes = CommonTypes::getBool($in);
184 $this->networkPermissions = NetworkPermissions::decode($in);
185 $this->isLoggingChat = CommonTypes::getBool($in);
186 $this->serverJoinInformation = CommonTypes::readOptional($in, ServerJoinInformation::read(...));
187 $this->serverTelemetryData = ServerTelemetryData::read($in);
191 CommonTypes::putActorUniqueId($out, $this->actorUniqueId);
192 CommonTypes::putActorRuntimeId($out, $this->actorRuntimeId);
193 VarInt::writeSignedInt($out, $this->playerGamemode);
195 CommonTypes::putVector3($out, $this->playerPosition);
197 LE::writeFloat($out, $this->pitch);
198 LE::writeFloat($out, $this->yaw);
200 $this->levelSettings->write($out);
202 CommonTypes::putString($out, $this->levelId);
203 CommonTypes::putString($out, $this->worldName);
204 CommonTypes::putString($out, $this->premiumWorldTemplateId);
205 CommonTypes::putBool($out, $this->isTrial);
206 $this->playerMovementSettings->write($out);
207 LE::writeUnsignedLong($out, $this->currentTick);
209 VarInt::writeSignedInt($out, $this->enchantmentSeed);
211 VarInt::writeUnsignedInt($out, count($this->blockPalette));
212 foreach($this->blockPalette as $entry){
213 CommonTypes::putString($out, $entry->getName());
214 $out->writeByteArray($entry->getStates()->getEncodedNbt());
217 CommonTypes::putString($out, $this->multiplayerCorrelationId);
218 CommonTypes::putBool($out, $this->enableNewInventorySystem);
219 CommonTypes::putString($out, $this->serverSoftwareVersion);
220 $out->writeByteArray($this->playerActorProperties->getEncodedNbt());
221 LE::writeUnsignedLong($out, $this->blockPaletteChecksum);
222 CommonTypes::putUUID($out, $this->worldTemplateId);
223 CommonTypes::putBool($out, $this->enableClientSideChunkGeneration);
224 CommonTypes::putBool($out, $this->blockNetworkIdsAreHashes);
225 $this->networkPermissions->encode($out);
226 CommonTypes::putBool($out, $this->isLoggingChat);
227 CommonTypes::writeOptional($out, $this->serverJoinInformation, fn(ByteBufferWriter $out,
ServerJoinInformation $info) => $info->write($out));
228 $this->serverTelemetryData->write($out);