TownyMessaging.sendErrorMsg(player, e.getMessage());
} catch (InvalidNameException e) {
TownyMessaging.sendErrorMsg(player, e.getMessage());
}
} else if (split[0].equalsIgnoreCase("homeblock")) {
Coord coord = Coord.parseCoord(player);
TownBlock townBlock;
TownyWorld world;
try {
if (plugin.getTownyUniverse().isWarTime())
throw new TownyException(TownySettings.getLangString("msg_war_cannot_do"));
world = TownyUniverse.getDataSource().getWorld(player.getWorld().getName());
if (world.getMinDistanceFromOtherTowns(coord, resident.getTown()) < TownySettings.getMinDistanceFromTownHomeblocks())
throw new TownyException(TownySettings.getLangString("msg_too_close"));
if (TownySettings.getMaxDistanceBetweenHomeblocks() > 0)
if ((world.getMinDistanceFromOtherTowns(coord, resident.getTown()) > TownySettings.getMaxDistanceBetweenHomeblocks()) && world.hasTowns())
throw new TownyException(TownySettings.getLangString("msg_too_far"));
townBlock = TownyUniverse.getDataSource().getWorld(player.getWorld().getName()).getTownBlock(coord);
oldWorld = town.getWorld();
town.setHomeBlock(townBlock);
TownyMessaging.sendMsg(player, String.format(TownySettings.getLangString("msg_set_town_home"), coord.toString()));
} catch (TownyException e) {
TownyMessaging.sendErrorMsg(player, e.getMessage());
return;
}
} else if (split[0].equalsIgnoreCase("spawn"))