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);
}
}
}
// teamFlags
String teamFlagsStr = warzoneConfig.getString("teamFlags");
if (teamFlagsStr != null && !teamFlagsStr.equals("")) {
String[] teamFlagsSplit = teamFlagsStr.split(";");
for (String teamFlagStr : teamFlagsSplit) {
if (teamFlagStr != null && !teamFlagStr.equals("")) {
String[] teamFlagStrSplit = teamFlagStr.split(",");
Team team = warzone.getTeamByKind(TeamKind.teamKindFromString(teamFlagStrSplit[0]));
if (team != null) {
int teamFlagX = Integer.parseInt(teamFlagStrSplit[1]);
int teamFlagY = Integer.parseInt(teamFlagStrSplit[2]);
int teamFlagZ = Integer.parseInt(teamFlagStrSplit[3]);
Location teamFlagLocation = new Location(world, teamFlagX, teamFlagY, teamFlagZ);
if (teamFlagStrSplit.length > 4) {
int yaw = Integer.parseInt(teamFlagStrSplit[4]);
teamFlagLocation.setYaw(yaw);
}
team.setTeamFlag(teamFlagLocation); // this may screw things up
}
}
}
}
// lobby
String lobbyStr = warzoneConfig.getString("lobby");
warzoneConfig.close();
if (createNewVolume) {
ZoneVolume zoneVolume = new ZoneVolume(warzone.getName(), world, warzone); // VolumeMapper.loadZoneVolume(warzone.getName(), warzone.getName(), war, warzone.getWorld(), warzone);
warzone.setVolume(zoneVolume);
}
// monument blocks
for (Monument monument : warzone.getMonuments()) {
try {
monument.setVolume(VolumeMapper.loadVolume(monument.getName(), warzone.getName(), world));
} catch (SQLException e) {
War.war.getLogger().log(Level.WARNING, "Failed to load some ambiguous old volume", e);
}
}
// team spawn blocks
for (Team team : warzone.getTeams()) {
for (Location spawnLocation : team.getTeamSpawns()) {
try {
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);
}
}
if (team.getTeamFlag() != null) {
try {
team.setFlagVolume(VolumeMapper.loadVolume(team.getName() + "flag", warzone.getName(), world));
} catch (SQLException e) {
War.war.getLogger().log(Level.WARNING, "Failed to load some ambiguous old volume", e);
}
}
}