42 public static function create(array $resourcePackStack, array $behaviorPackStack,
bool $mustAccept,
string $baseGameVersion,
Experiments $experiments,
bool $useVanillaEditorPacks) : self{
44 $result->resourcePackStack = $resourcePackStack;
45 $result->behaviorPackStack = $behaviorPackStack;
46 $result->mustAccept = $mustAccept;
47 $result->baseGameVersion = $baseGameVersion;
48 $result->experiments = $experiments;
49 $result->useVanillaEditorPacks = $useVanillaEditorPacks;
55 $behaviorPackCount = VarInt::readUnsignedInt($in);
56 while($behaviorPackCount-- > 0){
57 $this->behaviorPackStack[] = ResourcePackStackEntry::read($in);
60 $resourcePackCount = VarInt::readUnsignedInt($in);
61 while($resourcePackCount-- > 0){
62 $this->resourcePackStack[] = ResourcePackStackEntry::read($in);
65 $this->baseGameVersion = CommonTypes::getString($in);
66 $this->experiments = Experiments::read($in);
67 $this->useVanillaEditorPacks = CommonTypes::getBool($in);
73 VarInt::writeUnsignedInt($out, count($this->behaviorPackStack));
74 foreach($this->behaviorPackStack as $entry){
78 VarInt::writeUnsignedInt($out, count($this->resourcePackStack));
79 foreach($this->resourcePackStack as $entry){
83 CommonTypes::putString($out, $this->baseGameVersion);
84 $this->experiments->write($out);
85 CommonTypes::putBool($out, $this->useVanillaEditorPacks);