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

Reload a map

Comments in 'Plugin Development' started by Guillaume351, Mar 28, 2015.

  1. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    Hello,
    I am working on a skywars plugin, I need at the end of the game to replace the map by a new one. I tried to use copy() but apparently it's only for files.
    Thank you for your help.
  2. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    I found :
    Code:
     $zip->open($this->getServer()->getDataPath()."zipworld/worldName.".zip");
                $zip->extractTo($this->getServer()->getDataPath()."worlds/".$worldName."/");
                $zip->close();
    In the main folder (with "players", "worlds"...) create a folder name zipworlds and put a zip version of the world.
    Then just replace with the worldName. The only problem is I can't unload world (crash..) if you can help : http://forums.pocketmine.net/threads/level-unload-cause-crash.7407/

    Thanks
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Using ZIP is actually not performance optimized. Try referring to the file functions in the LegionPE plugin here:
    http://pastebin.com/g8YcuaBj

Share This Page

Advertisement