use of de.sanandrew.core.manpack.util.javatuples.Quartet in project ClaySoldiersMod by SanAndreasP.
the class RenderStatDisplayOverlay method renderMounts.
private void renderMounts(Minecraft mc) {
@SuppressWarnings("unchecked") List<EntityHorseMount> horses = mc.theWorld.getEntitiesWithinAABB(EntityHorseMount.class, getRangeAabbFromPlayer(mc.thePlayer));
List<Quartet<Integer, String, Integer, ItemStack>> teams = new ArrayList<>();
Map<String, Integer> teamCounts = Maps.newHashMap();
for (EntityHorseMount dex : horses) {
String team = EnumHorseType.VALUES[dex.getType()].toString();
if (teamCounts.containsKey(team)) {
teamCounts.put(team, teamCounts.get(team) + 1);
} else {
teamCounts.put(team, 1);
}
}
for (Entry<String, Integer> team : teamCounts.entrySet()) {
EnumHorseType teamInst = EnumHorseType.valueOf(team.getKey());
teams.add(Quartet.with(teamInst.typeColor, team.getKey(), team.getValue(), (ItemStack) null));
}
this.renderStats(mc, SAPUtils.translate(RegistryItems.statDisplay.getUnlocalizedName() + ".title.mounts"), teams, 110, 5);
}
use of de.sanandrew.core.manpack.util.javatuples.Quartet in project ClaySoldiersMod by SanAndreasP.
the class RenderStatDisplayOverlay method renderSoldiers.
private void renderSoldiers(Minecraft mc) {
@SuppressWarnings("unchecked") List<EntityClayMan> soldiers = mc.theWorld.getEntitiesWithinAABB(EntityClayMan.class, getRangeAabbFromPlayer(mc.thePlayer));
// team background color, team name, team count
List<Quartet<Integer, String, Integer, ItemStack>> teams = new ArrayList<>();
Map<String, Integer> teamCounts = Maps.newHashMap();
for (EntityClayMan dex : soldiers) {
String team = dex.getClayTeam();
if (teamCounts.containsKey(team)) {
teamCounts.put(team, teamCounts.get(team) + 1);
} else {
teamCounts.put(team, 1);
}
}
for (Entry<String, Integer> team : teamCounts.entrySet()) {
ClaymanTeam teamInst = ClaymanTeam.getTeam(team.getKey());
ItemStack renderedItem = new ItemStack(RegistryItems.dollSoldier);
ItemClayManDoll.setTeamForItem(team.getKey(), renderedItem);
teams.add(Quartet.with(teamInst.getTeamColor(), renderedItem.getUnlocalizedName() + ".color", team.getValue(), renderedItem));
}
this.renderStats(mc, SAPUtils.translate(RegistryItems.statDisplay.getUnlocalizedName() + ".title.soldiers"), teams, 5, 5);
}
Aggregations