This commit is contained in:
taoneill 2014-01-12 18:32:34 -05:00
commit 0c9ed4b238
2 changed files with 15 additions and 3 deletions

View File

@ -303,6 +303,13 @@ public class WarzoneTxtMapper {
int yaw = Integer.parseInt(teamStrSplit[4]);
teamLocation.setYaw(yaw);
}
File original = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamStrSplit[0] + ".dat");
File modified = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamStrSplit[0] + "0.dat");
try {
original.renameTo(modified);
} catch (Exception ignored) {
}
Team team = new Team(teamStrSplit[0], TeamKind.teamKindFromString(teamStrSplit[0]), Arrays.asList(teamLocation), warzone);
team.setRemainingLives(warzone.getTeamDefaultConfig().resolveInt(TeamConfig.LIFEPOOL));
warzone.getTeams().add(team);
@ -356,7 +363,7 @@ public class WarzoneTxtMapper {
for (Team team : warzone.getTeams()) {
for (Location spawnLocation : team.getTeamSpawns()) {
try {
team.setSpawnVolume(spawnLocation, VolumeMapper.loadVolume(team.getName(), warzone.getName(), world));
team.setSpawnVolume(spawnLocation, VolumeMapper.loadVolume(team.getName() + "0", warzone.getName(), world));
} catch (SQLException e) {
War.war.getLogger().log(Level.WARNING, "Failed to load some ambiguous old volume", e);
}

View File

@ -206,10 +206,15 @@ public class WarzoneYmlMapper {
teamSpawns.add(teamLocation);
File original = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamName + ".dat");
File modified = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamName + teamSpawns.indexOf(teamLocation) + ".dat");
File originalSql = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamName + ".sl3");
File modifiedSql = new File(War.war.getDataFolder().getPath() + "/dat/warzone-" + name + "/volume-" + teamName + teamSpawns.indexOf(teamLocation) + ".sl3");
try {
original.renameTo(modified);
} catch (Exception e) {
// Will be logged later
} catch (Exception ignored) {
}
try {
originalSql.renameTo(modifiedSql);
} catch (Exception ignored) {
}
}
if (warzoneRootSection.contains(teamInfoPrefix + "spawns")) {