public static String faction(String format, Player player) {
		boolean NoFaction = false;
		Plugin factions = Bukkit.getServer().getPluginManager().getPlugin("Factions");
		if (factions != null) {
			FPlayer fplayer = FPlayers.i.get(player);
			if (fplayer != null) {
				if (fplayer.hasFaction()) {
					format = format.replace("%FACTIONTAG%", fplayer.getRole().getPrefix() + fplayer.getTag());
					if (fplayer.getTitle().length() != 0) {
						format = format.replace("%FACTIONTITLE%", fplayer.getRole().getPrefix() + fplayer.getTitle());
					} else {
						NoFaction = true;
					}
				} else {
					NoFaction = true;
				}
			}
		} else {
			NoFaction = true;
		}

		if (NoFaction) {
			format = format
					.replace("%FACTIONTAG% ", "%FACTIONTAG%")
					.replace("%FACTIONTAG%", "")
					.replace("%FACTIONTITLE% ", "%FACTIONTITLE%")
					.replace("%FACTIONTITLE%", "");
		}

		return format;
	}