1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

getServer?

Discussion in 'Facepalm' started by LucGamesDE, May 29, 2017.

  1. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    What's the difference between $this->getServer() and Server:: getInstance()?
     
    Legoboy0215 likes this.
  2. Defications2po

    Defications2po Witch

    Messages:
    51
  3. Legoboy0215

    Legoboy0215 Witch

    Messages:
    64
    GitHub:
    legoboy0215
    Both return a Server object ($this->getServer() & Server::getInstance()). Basically the same thing, but for some reason @PEMapModder recommends $this->getServer due to some potential issues with static objects? (Forgot what he said exactly, but something like that)

    Also, $this->getServer() requires an Plugin instance, while Server::getInstance can be almost called everywhere.

    Please contribute something useful to the thread. This question is not exactly facepalm worthy...
     
  4. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    Thanks!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.