use pocketmine\network\mcpe\handler\PacketHandler; 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() : void{ $this->gameRules = $this->getGameRules(); } protected function encodePayload() : void{ $this->putGameRules($this->gameRules); } public function handle(PacketHandler $handler) : bool{ return $handler->handleGameRulesChanged($this); } }