39 public static function create(array $resourcePackStack,
bool $mustAccept,
string $baseGameVersion,
Experiments $experiments,
bool $useVanillaEditorPacks) : self{
41 $result->resourcePackStack = $resourcePackStack;
42 $result->mustAccept = $mustAccept;
43 $result->baseGameVersion = $baseGameVersion;
44 $result->experiments = $experiments;
45 $result->useVanillaEditorPacks = $useVanillaEditorPacks;
52 $resourcePackCount = VarInt::readUnsignedInt($in);
53 while($resourcePackCount-- > 0){
54 $this->resourcePackStack[] = ResourcePackStackEntry::read($in);
57 $this->baseGameVersion = CommonTypes::getString($in);
58 $this->experiments = Experiments::read($in);
59 $this->useVanillaEditorPacks = CommonTypes::getBool($in);
65 VarInt::writeUnsignedInt($out, count($this->resourcePackStack));
66 foreach($this->resourcePackStack as $entry){
70 CommonTypes::putString($out, $this->baseGameVersion);
71 $this->experiments->write($out);
72 CommonTypes::putBool($out, $this->useVanillaEditorPacks);