Parse map properly, bug fixes

This commit is contained in:
Shaun Bennett 2014-08-16 16:19:33 -05:00
parent e286a45de8
commit b6c31294c7
2 changed files with 9 additions and 7 deletions

View File

@ -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);

View File

@ -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);