Only show player location for allies/self

This commit is contained in:
Shaun Bennett 2015-11-17 18:42:06 -05:00
parent 01a57dde2f
commit 4f63d90bac

View File

@ -20,6 +20,7 @@ import mineplex.game.clans.clans.ClanRole;
import mineplex.game.clans.clans.ClansManager;
import mineplex.game.clans.clans.ClansPlayer;
import mineplex.game.clans.clans.ClansPlayerComparator;
import mineplex.game.clans.clans.ClansUtility;
import mineplex.game.clans.clans.gui.ClanShop;
import mineplex.game.clans.clans.gui.ClanIcon;
@ -51,6 +52,8 @@ public class ClanWhoPage extends ClanPageBase
private void build(ClanInfo clanInfo)
{
ClansUtility.ClanRelation relation = getPlugin().getClanUtility().rel(clanInfo, _lookupClan);
// Main Clan Info
{
int slot = 4;
@ -112,7 +115,7 @@ public class ClanWhoPage extends ClanPageBase
int slot = 18;
for (ClansPlayer player : UtilAlg.sortSet(_lookupClan.getMembers().values(), new ClansPlayerComparator()))
{
addPlayer(slot, player);
addPlayer(slot, player, relation == ClansUtility.ClanRelation.ALLY || relation == ClansUtility.ClanRelation.ALLY_TRUST || relation == ClansUtility.ClanRelation.SELF);
slot++;
}
}
@ -123,13 +126,13 @@ public class ClanWhoPage extends ClanPageBase
}
}
private void addPlayer(int slot, ClansPlayer clansPlayer)
private void addPlayer(int slot, ClansPlayer clansPlayer, boolean showLocation)
{
String itemName = (clansPlayer.isOnline() ? C.cGreenB : C.cRedB) + clansPlayer.getPlayerName();
ArrayList<String> lore = new ArrayList<String>(5);
lore.add(" ");
lore.add(C.Reset + C.cYellow + "Role " + C.cWhite + clansPlayer.getRole().getFriendlyName());
if (clansPlayer.isOnline())
if (showLocation && clansPlayer.isOnline())
{
Player player = UtilPlayer.searchExact(clansPlayer.getUuid());
if (player != null)