Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Solved] [NewAPI] Load a Anvil worlds and get worlds by name

Comments in 'Plugin Development' started by EkiFoX, Sep 6, 2014.

  1. EkiFoX
    Offline

    EkiFoX Active Member Plugin Developer

    Joined:
    Feb 28, 2014
    Posts:
    94
    Plugins:
    2
    Minecraft User:
    ekifox
    Hi again,
    1) i put my pc map in worlds folder, and use loadLevel function for load it, but loadLevel say me "blabla level not found".

    2) i use a default level with getLevelByName("world") function and it dont work :(

    Windows 8.1
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The exact code?
  3. Minetox
    Offline

    Minetox New Member

    Joined:
    Jun 23, 2014
    Posts:
    31
    Minecraft User:
    Minetox
    Hmm, Can you show us your code if this not work? :
    PHP:
    server::getInstance()->loadLevel($LevelName);
    and
    PHP:
    server::getInstance()->getLevelbyName($LevelName); 
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Use $this->getServer() or whatever variable reference, but try not to refer to the static reference (or the static getter).
  5. EkiFoX
    Offline

    EkiFoX Active Member Plugin Developer

    Joined:
    Feb 28, 2014
    Posts:
    94
    Plugins:
    2
    Minecraft User:
    ekifox
    All works fine, $thread->close().
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    But I always hated static variables.

    Wait... Is that the reason why you mentioned threads?
  7. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    he wants to close this thread since he got his problem solved.
    EkiFoX and PEMapModder like this.
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I thought he said you need to close a PHP thread to use Server::getInstance() :p
    jython234 likes this.
  9. EkiFoX
    Offline

    EkiFoX Active Member Plugin Developer

    Joined:
    Feb 28, 2014
    Posts:
    94
    Plugins:
    2
    Minecraft User:
    ekifox
    How said in Russia "Бывает..."
  10. vlad46
    Offline

    vlad46 New Member

    Joined:
    Mar 21, 2014
    Posts:
    12
    Ну что же сказать :D
    jython234 and EkiFoX like this.

Share This Page

Advertisement