Faction leader to inspect page

This commit is contained in:
Rsl1122 2017-11-28 20:38:06 +02:00
parent bc2f181975
commit f8039e568f
3 changed files with 9 additions and 4 deletions

View File

@ -7,12 +7,14 @@ package com.djrapitops.pluginbridge.plan.factions;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.MPlayer;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.Settings;
import main.java.com.djrapitops.plan.data.additional.AnalysisContainer;
import main.java.com.djrapitops.plan.data.additional.ContainerSize;
import main.java.com.djrapitops.plan.data.additional.InspectContainer;
import main.java.com.djrapitops.plan.data.additional.PluginData;
import main.java.com.djrapitops.plan.utilities.FormatUtils;
import main.java.com.djrapitops.plan.utilities.html.Html;
import java.util.*;
import java.util.stream.Collectors;
@ -40,9 +42,12 @@ public class FactionsData extends PluginData {
double power = mPlayer.getPower();
double maxPower = mPlayer.getPowerMax();
String powerString = FormatUtils.cutDecimals(power) + " / " + FormatUtils.cutDecimals(maxPower);
String factionLeader = faction.getLeader().getName();
String factionLeaderLink = Html.LINK.parse(Plan.getPlanAPI().getPlayerInspectPageLink(factionLeader), factionLeader);
inspectContainer.addValue(getWithIcon("Faction", "flag", "deep-purple"), factionName);
inspectContainer.addValue(getWithIcon("Power", "bolt", "purple"), powerString);
inspectContainer.addValue(getWithIcon("Leader", "user", "purple"), factionLeaderLink);
}
return inspectContainer;

View File

@ -45,7 +45,7 @@ public class KingdomsData extends PluginData {
String king = kingdom.getKingName();
String link = Html.LINK.parse(Plan.getPlanAPI().getPlayerInspectPageLink(king), king);
inspectContainer.addValue(getWithIcon("Kingdom", "shield", "amber"), kingdomName);
inspectContainer.addValue(" " + getWithIcon("King", "user", "amber"), link);
inspectContainer.addValue(getWithIcon("King", "user", "amber"), link);
}
}

View File

@ -48,17 +48,17 @@ public class TownyData extends PluginData {
String townMayor = Html.LINK.parse(Plan.getPlanAPI().getPlayerInspectPageLink(mayorName), mayorName);
inspectContainer.addValue(getWithIcon("Town", "bank", "brown"), townName);
inspectContainer.addValue(" " + getWithIcon("Mayor", "user", "brown"), townMayor);
inspectContainer.addValue(getWithIcon("Town Mayor", "user", "brown"), townMayor);
try {
Coord homeBlock = town.getHomeBlock().getCoord();
String coordinates = "x: " + homeBlock.getX() + " z: " + homeBlock.getZ();
inspectContainer.addValue(" " + getWithIcon("Coordinates", "map-pin", "red"), coordinates);
inspectContainer.addValue(getWithIcon("Town Coordinates", "map-pin", "red"), coordinates);
} catch (TownyException e) {
}
int residents = town.getResidents().size();
inspectContainer.addValue(" " + getWithIcon("Residents", "users", "brown"), residents);
inspectContainer.addValue(getWithIcon("Town Residents", "users", "brown"), residents);
} else {
inspectContainer.addValue(getWithIcon("Town", "bank", "brown"), "No Town");
}