Parse map properly, bug fixes
This commit is contained in:
parent
e286a45de8
commit
b6c31294c7
@ -49,11 +49,14 @@ public class WorldManager
|
||||
FileUtils.deleteQuietly(new File(world.getName() + File.separator + fileName));
|
||||
}
|
||||
|
||||
//Copy for Parsing
|
||||
//Copy for Parsing
|
||||
|
||||
String parseWorldName = "parse" + world.getName().replaceFirst("map", "");
|
||||
|
||||
try
|
||||
{
|
||||
//Delete if already exists
|
||||
File destination = new File("parse_" + world.getName());
|
||||
File destination = new File(parseWorldName);
|
||||
if (destination.exists())
|
||||
FileUtils.deleteDirectory(destination);
|
||||
|
||||
@ -65,7 +68,7 @@ public class WorldManager
|
||||
return null;
|
||||
}
|
||||
|
||||
return Bukkit.createWorld(new WorldCreator("parse_" + world.getName()));
|
||||
return Bukkit.createWorld(new WorldCreator(parseWorldName));
|
||||
}
|
||||
|
||||
public void finalizeParsedWorld(World world)
|
||||
@ -99,10 +102,9 @@ public class WorldManager
|
||||
FileUtils.deleteQuietly(new File(world.getName() + File.separator + file.getName()));
|
||||
}
|
||||
|
||||
MapData data = Host.GetData(world.getName().substring(6));
|
||||
|
||||
String fileName = data.GameType + "_" + data.MapName + ".zip";
|
||||
MapData data = Host.GetData(world.getName().replace("parse", "map"));
|
||||
GameType gameType = data.GameType;
|
||||
String fileName = gameType + "_" + data.MapName + ".zip";
|
||||
|
||||
ZipUtil.ZipFolders(Paths.get(world.getName()).toAbsolutePath().toString(), fileName, dirList, fileList);
|
||||
|
||||
|
@ -103,7 +103,7 @@ public class MapCommand extends BaseCommand
|
||||
//Teleport
|
||||
message(player, "Teleporting to World: " + F.elem(worldName));
|
||||
|
||||
player.teleport(getPlugin().getSpawnLocation());
|
||||
player.teleport(new Location(world, 0, 106, 0));
|
||||
|
||||
MapData data = getPlugin().GetData(worldName);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user