99 string $premiumWorldTemplateId,
103 int $enchantmentSeed,
104 string $multiplayerCorrelationId,
105 bool $enableNewInventorySystem,
106 string $serverSoftwareVersion,
107 UuidInterface $worldTemplateId,
108 bool $enableClientSideChunkGeneration,
109 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->blockPalette = $blockPalette;
140 $result->itemTable = $itemTable;
145 $this->actorUniqueId = $in->getActorUniqueId();
147 $this->playerGamemode = $in->
getVarInt();
154 $this->levelSettings = LevelSettings::read($in);
158 $this->premiumWorldTemplateId = $in->
getString();
159 $this->isTrial = $in->
getBool();
160 $this->playerMovementSettings = PlayerMovementSettings::read($in);
161 $this->currentTick = $in->
getLLong();
163 $this->enchantmentSeed = $in->
getVarInt();
165 $this->blockPalette = [];
168 $state = $in->getNbtCompoundRoot();
172 $this->itemTable = [];
176 $isComponentBased = $in->
getBool();
178 $this->itemTable[] =
new ItemTypeEntry($stringId, $numericId, $isComponentBased);
181 $this->multiplayerCorrelationId = $in->
getString();
182 $this->enableNewInventorySystem = $in->
getBool();
183 $this->serverSoftwareVersion = $in->
getString();
184 $this->playerActorProperties =
new CacheableNbt($in->getNbtCompoundRoot());
185 $this->blockPaletteChecksum = $in->
getLLong();
186 $this->worldTemplateId = $in->
getUUID();
187 $this->enableClientSideChunkGeneration = $in->
getBool();
188 $this->blockNetworkIdsAreHashes = $in->
getBool();
189 $this->networkPermissions = NetworkPermissions::decode($in);
193 $out->putActorUniqueId($this->actorUniqueId);
194 $out->putActorRuntimeId($this->actorRuntimeId);
199 $out->putLFloat($this->pitch);
200 $out->putLFloat($this->yaw);
202 $this->levelSettings->write($out);
204 $out->putString($this->levelId);
205 $out->putString($this->worldName);
206 $out->putString($this->premiumWorldTemplateId);
207 $out->putBool($this->isTrial);
208 $this->playerMovementSettings->write($out);
209 $out->putLLong($this->currentTick);
214 foreach($this->blockPalette as $entry){
215 $out->putString($entry->getName());
216 $out->put($entry->getStates()->getEncodedNbt());
220 foreach($this->itemTable as $entry){
221 $out->putString($entry->getStringId());
222 $out->putLShort($entry->getNumericId());
223 $out->putBool($entry->isComponentBased());
226 $out->putString($this->multiplayerCorrelationId);
227 $out->putBool($this->enableNewInventorySystem);
228 $out->putString($this->serverSoftwareVersion);
229 $out->put($this->playerActorProperties->getEncodedNbt());
230 $out->putLLong($this->blockPaletteChecksum);
231 $out->putUUID($this->worldTemplateId);
232 $out->putBool($this->enableClientSideChunkGeneration);
233 $out->putBool($this->blockNetworkIdsAreHashes);
234 $this->networkPermissions->encode($out);