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

How to rename a world folder name?

Discussion in 'Development' started by BEcraft, Jan 19, 2017.

  1. BEcraft

    BEcraft Slime

    Messages:
    79
    GitHub:
    BEcraft
    Hi :D
    I need that someone tell me how to rename any world folder name because I really don't know xD
    Something like this:
    PHP:
    case 'rename':
    $folder $this->getServer()->getDataPath() . "worlds/" $args[0]; //maybe?

    //and rename it like
    rename($folder$args[1]); 
    I don't know how to do it
     
    Last edited: Jan 19, 2017
  2. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Hmm... I'm not sure, but I don't think the folder is the level name, I think "level.dat" is what saves the level name.
     
  3. BEcraft

    BEcraft Slime

    Messages:
    79
    GitHub:
    BEcraft
    Yes I know but is there any way to rename the folder name but nope inside folder files? like /worlds/lobby change it to /worlds/test
     
  4. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Try this:
    PHP:
    $worlds $this->getServer()->getDataPath() . 'worlds/';
    $oldWorldName 'old';
    $newWorldName 'new';
    rename($worlds $oldWorldName$worlds .  $newWorldName);
     
  5. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Some functions use the world name in level.dat and some use the folder name (don't know which one uses which one of those <-- dat English xD)
    This could possibly help for changing the level.dat values: https://github.com/Muirfield/ManyWorlds/blob/master/src/aliuly/manyworlds/MwLvDat.php
     
  6. kaliiks

    kaliiks Zombie

    Messages:
    250
    Go to folder worlds right click folder name click rename and rename it :D :p:p
    Best method :d
     
  7. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    WTF XD
     
  8. kaliiks

    kaliiks Zombie

    Messages:
    250
    :D
     
  9. BEcraft

    BEcraft Slime

    Messages:
    79
    GitHub:
    BEcraft
    xDD
     
  10. TheBeefSteak

    TheBeefSteak Spider

    Messages:
    9
    GitHub:
    angusbeefsteak
    In your server.properties file you can change this
    Code:
    level-name=world
     
  11. BEcraft

    BEcraft Slime

    Messages:
    79
    GitHub:
    BEcraft
    Yes I know just I wanted to know if its possible to rename a folder name by commands :D
     
  12. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    That's something completely off-topic.

    The poster wants to know how to change the name of an existing world via a plugin.

    Just the folder, or the value in level.dat, too?
     
  13. BEcraft

    BEcraft Slime

    Messages:
    79
    GitHub:
    BEcraft
    Just the folder :)
     
  14. StuntzCo

    StuntzCo Baby Zombie

    Messages:
    197
    okay i just had this same problem today i wanted to change a world name or level whatever i renamed the world folder Server-lobby i went into server properties and changed level to Server.properties and opened the level.dat with a text editer and changed the name to Server-Lobby and now when i shut my server down it says unloaded level " " as if i didn't name it :d

    its the small things that are a pain in the butt
     
  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.