From 51f1ceee1432e16326bba973ce8631fca68cd62f Mon Sep 17 00:00:00 2001 From: Byteflux Date: Sun, 19 Oct 2014 15:11:03 -0700 Subject: [PATCH] Show power next to member names in /f show --- .../massivecraft/factions/cmd/CmdShow.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdShow.java b/src/main/java/com/massivecraft/factions/cmd/CmdShow.java index b200b33c..13fc757f 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdShow.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdShow.java @@ -134,8 +134,14 @@ public class CmdShow extends FCommand { // List the members... String onlineList = p.txt.parse("") + "Members online: "; String offlineList = p.txt.parse("") + "Members offline: "; + boolean canSeePower = Permission.POWER_ANY.has(me); for (FPlayer follower : admins) { - listpart = follower.getNameAndTitle(fme) + p.txt.parse("") + ", "; + listpart = follower.getNameAndTitle(fme); + if (canSeePower) { + listpart += p.txt.parse("(%d), ", follower.getPowerRounded()); + } else { + listpart += p.txt.parse(", "); + } if (follower.isOnlineAndVisibleTo(me)) { onlineList += listpart; } else { @@ -143,7 +149,12 @@ public class CmdShow extends FCommand { } } for (FPlayer follower : mods) { - listpart = follower.getNameAndTitle(fme) + p.txt.parse("") + ", "; + listpart = follower.getNameAndTitle(fme); + if (canSeePower) { + listpart += p.txt.parse("(%d), ", follower.getPowerRounded()); + } else { + listpart += p.txt.parse(", "); + } if (follower.isOnlineAndVisibleTo(me)) { onlineList += listpart; } else { @@ -151,7 +162,12 @@ public class CmdShow extends FCommand { } } for (FPlayer follower : normals) { - listpart = follower.getNameAndTitle(fme) + p.txt.parse("") + ", "; + listpart = follower.getNameAndTitle(fme); + if (canSeePower) { + listpart += p.txt.parse("(%d), ", follower.getPowerRounded()); + } else { + listpart += p.txt.parse(", "); + } if (follower.isOnlineAndVisibleTo(me)) { onlineList += listpart; } else {