13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
23 public const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_STACK_PACKET;
26 public array $resourcePackStack = [];
28 public array $behaviorPackStack = [];
29 public bool $mustAccept =
false;
32 public bool $useVanillaEditorPacks;
39 public static function create(array $resourcePackStack, array $behaviorPackStack,
bool $mustAccept,
string $baseGameVersion,
Experiments $experiments,
bool $useVanillaEditorPacks) : self{
41 $result->resourcePackStack = $resourcePackStack;
42 $result->behaviorPackStack = $behaviorPackStack;
43 $result->mustAccept = $mustAccept;
44 $result->baseGameVersion = $baseGameVersion;
45 $result->experiments = $experiments;
46 $result->useVanillaEditorPacks = $useVanillaEditorPacks;
51 $this->mustAccept = $in->getBool();
53 while($behaviorPackCount-- > 0){
54 $this->behaviorPackStack[] = ResourcePackStackEntry::read($in);
58 while($resourcePackCount-- > 0){
59 $this->resourcePackStack[] = ResourcePackStackEntry::read($in);
62 $this->baseGameVersion = $in->
getString();
63 $this->experiments = Experiments::read($in);
64 $this->useVanillaEditorPacks = $in->
getBool();
68 $out->putBool($this->mustAccept);
71 foreach($this->behaviorPackStack as $entry){
76 foreach($this->resourcePackStack as $entry){
80 $out->putString($this->baseGameVersion);
81 $this->experiments->write($out);
82 $out->putBool($this->useVanillaEditorPacks);
86 return $handler->handleResourcePackStack($this);
const MINECRAFT_VERSION_NETWORK
static create(array $resourcePackStack, array $behaviorPackStack, bool $mustAccept, string $baseGameVersion, Experiments $experiments, bool $useVanillaEditorPacks)
handle(PacketHandlerInterface $handler)
encodePayload(PacketSerializer $out)
decodePayload(PacketSerializer $in)
putUnsignedVarInt(int $v)