Set a name for unnamed worlds

This commit is contained in:
Shoghi Cervantes Pueyo 2013-02-09 20:39:52 +01:00
parent 6dcf9e5da1
commit 7c33c4f75a

View File

@ -352,6 +352,9 @@ class ServerAPI{
if(file_exists($dir."level.dat")){
$nbt = new NBT();
$level = parseNBTData($nbt->loadFile($dir."level.dat"));
if($level["LevelName"] == ""){
$level["LevelName"] = "world".time();
}
console("[DEBUG] Importing map \"".$level["LevelName"]."\" gamemode ".$level["GameType"]." with seed ".$level["RandomSeed"], true, true, 2);
unset($level["Player"]);
$lvName = $level["LevelName"]."/";