pocketmine\Server::getInstance PHP Method

getInstance() public static method

public static getInstance ( ) : Server
return Server
    public static function getInstance()
    {
        return self::$instance;
    }

Usage Example

 public function sendPacket(DataPacket $packet)
 {
     Server::getInstance()->getPluginManager()->callEvent($ev = new CustomPacketSendEvent($packet));
     if (!$ev->isCancelled()) {
         $this->pushInternalQueue([chr(Info::PACKET_SEND), $packet]);
     }
 }
All Usage Examples Of pocketmine\Server::getInstance
Server