use pocketmine\network\mcpe\handler\PacketHandler; use pocketmine\network\mcpe\serializer\NetworkBinaryStream; class GameRulesChangedPacket extends DataPacket implements ClientboundPacket{ public const NETWORK_ID = ProtocolInfo::GAME_RULES_CHANGED_PACKET; /** * @var mixed[][] * @phpstan-var array */ public $gameRules = []; protected function decodePayload(NetworkBinaryStream $in) : void{ $this->gameRules = $in->getGameRules(); } protected function encodePayload(NetworkBinaryStream $out) : void{ $out->putGameRules($this->gameRules); } public function handle(PacketHandler $handler) : bool{ return $handler->handleGameRulesChanged($this); } }