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