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

[1.5] About rebuild the world

Comments in 'Plugin Development' started by Misaka05323, Apr 27, 2015.

  1. Misaka05323
    Offline

    Misaka05323 New Member

    Joined:
    Dec 17, 2014
    Posts:
    5
    Minecraft User:
    Misaka05323
    At the 1.4 version of pm, i rebuild the world by delete the "mcr" file.Just like the code as below:
    PHP:
                $handle opendir("./worlds/zy/region");
                while((
    $filename readdir($handle))!==false){
                    if(
    $filename!="." && $filename!=".."){
                        
    unlink("./worlds/zy/region/$filename");
                    }
                }
                
    $seed null;
                
    $generator null;
                
    $options = [];
                
    $this->getServer()->generateLevel("zy"$seed$generator$options);
                
    $this->getServer()->loadLevel("zy");
    It works well,the world named "zy" will be rebuilded.
    But when the plugin run at the 1.5,it worked wrongly.
    When i teleported to the "zy" world, my character just like reached a world with nothing and couldn't link the server anymore until i delete my player data at the folder /players.
    Can this problem be solved?Thank you very much!
  2. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    Unload and load the world.
    HotFireyDeath likes this.

Share This Page

Advertisement