94 string $premiumWorldTemplateId,
99 string $multiplayerCorrelationId,
100 bool $enableNewInventorySystem,
101 string $serverSoftwareVersion,
102 UuidInterface $worldTemplateId,
103 bool $enableClientSideChunkGeneration,
104 bool $blockNetworkIdsAreHashes,
110 $result->actorUniqueId = $actorUniqueId;
111 $result->actorRuntimeId = $actorRuntimeId;
112 $result->playerGamemode = $playerGamemode;
113 $result->playerPosition = $playerPosition;
114 $result->pitch = $pitch;
117 $result->levelSettings = $levelSettings;
118 $result->levelId = $levelId;
119 $result->worldName = $worldName;
120 $result->premiumWorldTemplateId = $premiumWorldTemplateId;
121 $result->isTrial = $isTrial;
122 $result->playerMovementSettings = $playerMovementSettings;
123 $result->currentTick = $currentTick;
124 $result->enchantmentSeed = $enchantmentSeed;
125 $result->multiplayerCorrelationId = $multiplayerCorrelationId;
126 $result->enableNewInventorySystem = $enableNewInventorySystem;
127 $result->serverSoftwareVersion = $serverSoftwareVersion;
128 $result->worldTemplateId = $worldTemplateId;
129 $result->enableClientSideChunkGeneration = $enableClientSideChunkGeneration;
130 $result->blockNetworkIdsAreHashes = $blockNetworkIdsAreHashes;
131 $result->networkPermissions = $networkPermissions;
132 $result->blockPalette = $blockPalette;
138 $this->actorUniqueId =
CommonTypes::getActorUniqueId($in);
139 $this->actorRuntimeId = CommonTypes::getActorRuntimeId($in);
140 $this->playerGamemode = VarInt::readSignedInt($in);
142 $this->playerPosition = CommonTypes::getVector3($in);
144 $this->pitch = LE::readFloat($in);
145 $this->yaw = LE::readFloat($in);
147 $this->levelSettings = LevelSettings::read($in);
149 $this->levelId = CommonTypes::getString($in);
150 $this->worldName = CommonTypes::getString($in);
151 $this->premiumWorldTemplateId = CommonTypes::getString($in);
152 $this->isTrial = CommonTypes::getBool($in);
153 $this->playerMovementSettings = PlayerMovementSettings::read($in);
154 $this->currentTick = LE::readUnsignedLong($in);
156 $this->enchantmentSeed = VarInt::readSignedInt($in);
158 $this->blockPalette = [];
159 for($i = 0, $len = VarInt::readUnsignedInt($in); $i < $len; ++$i){
160 $blockName = CommonTypes::getString($in);
161 $state = CommonTypes::getNbtCompoundRoot($in);
165 $this->multiplayerCorrelationId = CommonTypes::getString($in);
166 $this->enableNewInventorySystem = CommonTypes::getBool($in);
167 $this->serverSoftwareVersion = CommonTypes::getString($in);
168 $this->playerActorProperties =
new CacheableNbt(CommonTypes::getNbtCompoundRoot($in));
169 $this->blockPaletteChecksum = LE::readUnsignedLong($in);
170 $this->worldTemplateId = CommonTypes::getUUID($in);
171 $this->enableClientSideChunkGeneration = CommonTypes::getBool($in);
172 $this->blockNetworkIdsAreHashes = CommonTypes::getBool($in);
173 $this->networkPermissions = NetworkPermissions::decode($in);
177 CommonTypes::putActorUniqueId($out, $this->actorUniqueId);
178 CommonTypes::putActorRuntimeId($out, $this->actorRuntimeId);
179 VarInt::writeSignedInt($out, $this->playerGamemode);
181 CommonTypes::putVector3($out, $this->playerPosition);
183 LE::writeFloat($out, $this->pitch);
184 LE::writeFloat($out, $this->yaw);
186 $this->levelSettings->write($out);
188 CommonTypes::putString($out, $this->levelId);
189 CommonTypes::putString($out, $this->worldName);
190 CommonTypes::putString($out, $this->premiumWorldTemplateId);
191 CommonTypes::putBool($out, $this->isTrial);
192 $this->playerMovementSettings->write($out);
193 LE::writeUnsignedLong($out, $this->currentTick);
195 VarInt::writeSignedInt($out, $this->enchantmentSeed);
197 VarInt::writeUnsignedInt($out, count($this->blockPalette));
198 foreach($this->blockPalette as $entry){
199 CommonTypes::putString($out, $entry->getName());
200 $out->writeByteArray($entry->getStates()->getEncodedNbt());
203 CommonTypes::putString($out, $this->multiplayerCorrelationId);
204 CommonTypes::putBool($out, $this->enableNewInventorySystem);
205 CommonTypes::putString($out, $this->serverSoftwareVersion);
206 $out->writeByteArray($this->playerActorProperties->getEncodedNbt());
207 LE::writeUnsignedLong($out, $this->blockPaletteChecksum);
208 CommonTypes::putUUID($out, $this->worldTemplateId);
209 CommonTypes::putBool($out, $this->enableClientSideChunkGeneration);
210 CommonTypes::putBool($out, $this->blockNetworkIdsAreHashes);
211 $this->networkPermissions->encode($out);