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

ManyWorlds

Comments in 'Plugin Development' started by PragaKart67z, Oct 24, 2015.

Thread Status:
Not open for further replies.
  1. PragaKart67z
    Offline

    PragaKart67z New Member

    Joined:
    Aug 16, 2015
    Posts:
    41
    Minecraft User:
    PragaKart67
    Hi I am using a combonation of ManyWorlds and Simplewarp. When the server restarts, and i try to warp to another world, it says it is not loaded. Anyway I can enable all worlds to load when the server restarts? Thankyou.
  2. MyNameIsAnti
    Offline

    MyNameIsAnti New Member

    Joined:
    Oct 4, 2015
    Posts:
    2
    Minecraft User:
    AntiGaming
    Yes you can.
    In the onEnable function, scan for all directories in the 'worlds' folder and use a foreach loop to load all

    Code:
    public function onEnable()
    {
    $this->getServer()->getPluginManager()->registerEvents($this, $this);
    $unloadedWorlds = scandir($this->getServer()->getDataPath() . "/worlds");
    foreach($unloadedWorlds as $world)
    {
    $this->getServer->loadLevel($world);
    }
    }
    
    Legoboy0215 likes this.
  3. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    This does not have anything to do with ManyWorlds
  4. MyNameIsAnti
    Offline

    MyNameIsAnti New Member

    Joined:
    Oct 4, 2015
    Posts:
    2
    Minecraft User:
    AntiGaming
    * Anyway I can enable all worlds to load when the server restarts? *
    - Legoboy0215
  5. PragaKart67z
    Offline

    PragaKart67z New Member

    Joined:
    Aug 16, 2015
    Posts:
    41
    Minecraft User:
    PragaKart67
    Ok thankyou! =D
Thread Status:
Not open for further replies.

Share This Page

Advertisement