More reformatting
This commit is contained in:
@@ -14,27 +14,20 @@ import java.util.Collection;
|
||||
public class CmdShow extends FCommand {
|
||||
|
||||
public CmdShow() {
|
||||
this.aliases.add("show");
|
||||
this.aliases.add("who");
|
||||
this.aliases.add("show"); this.aliases.add("who");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("faction tag", "yours");
|
||||
|
||||
this.permission = Permission.SHOW.node;
|
||||
this.disableOnLock = false;
|
||||
this.permission = Permission.SHOW.node; this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
senderMustBePlayer = true; senderMustBeMember = false; senderMustBeModerator = false; senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
Faction faction = myFaction;
|
||||
if (this.argIsSet(0)) {
|
||||
faction = this.argAsFaction(0);
|
||||
if (faction == null) { return; }
|
||||
Faction faction = myFaction; if (this.argIsSet(0)) {
|
||||
faction = this.argAsFaction(0); if (faction == null) { return; }
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
@@ -46,14 +39,12 @@ public class CmdShow extends FCommand {
|
||||
Collection<FPlayer> mods = faction.getFPlayersWhereRole(Role.MODERATOR);
|
||||
Collection<FPlayer> normals = faction.getFPlayersWhereRole(Role.NORMAL);
|
||||
|
||||
msg(p.txt.titleize(faction.getTag(fme)));
|
||||
msg("<a>Description: <i>%s", faction.getDescription());
|
||||
msg(p.txt.titleize(faction.getTag(fme))); msg("<a>Description: <i>%s", faction.getDescription());
|
||||
if (!faction.isNormal()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String peaceStatus = "";
|
||||
if (faction.isPeaceful()) {
|
||||
String peaceStatus = ""; if (faction.isPeaceful()) {
|
||||
peaceStatus = " " + Conf.colorNeutral + "This faction is Peaceful";
|
||||
}
|
||||
|
||||
@@ -70,8 +61,7 @@ public class CmdShow extends FCommand {
|
||||
// show the land value
|
||||
if (Econ.shouldBeUsed()) {
|
||||
double value = Econ.calculateTotalLandValue(faction.getLandRounded());
|
||||
double refund = value * Conf.econClaimRefundMultiplier;
|
||||
if (value > 0) {
|
||||
double refund = value * Conf.econClaimRefundMultiplier; if (value > 0) {
|
||||
String stringValue = Econ.moneyString(value);
|
||||
String stringRefund = (refund > 0.0) ? (" (" + Econ.moneyString(refund) + " depreciated)") : "";
|
||||
msg("<a>Total land value: <i>" + stringValue + stringRefund);
|
||||
@@ -86,67 +76,53 @@ public class CmdShow extends FCommand {
|
||||
String listpart;
|
||||
|
||||
// List relation
|
||||
String allyList = p.txt.parse("<a>Allies: ");
|
||||
String enemyList = p.txt.parse("<a>Enemies: ");
|
||||
String allyList = p.txt.parse("<a>Allies: "); String enemyList = p.txt.parse("<a>Enemies: ");
|
||||
for (Faction otherFaction : Factions.i.get()) {
|
||||
if (otherFaction == faction) { continue; }
|
||||
|
||||
Relation rel = otherFaction.getRelationTo(faction);
|
||||
if (!rel.isAlly() && !rel.isEnemy()) {
|
||||
Relation rel = otherFaction.getRelationTo(faction); if (!rel.isAlly() && !rel.isEnemy()) {
|
||||
continue; // if not ally or enemy, drop out now so we're not wasting time on it; good performance boost
|
||||
}
|
||||
|
||||
listpart = otherFaction.getTag(fme) + p.txt.parse("<i>") + ", ";
|
||||
if (rel.isAlly()) { allyList += listpart; }
|
||||
else if (rel.isEnemy()) { enemyList += listpart; }
|
||||
}
|
||||
if (allyList.endsWith(", ")) { allyList = allyList.substring(0, allyList.length() - 2); }
|
||||
if (rel.isAlly()) { allyList += listpart; } else if (rel.isEnemy()) { enemyList += listpart; }
|
||||
} if (allyList.endsWith(", ")) { allyList = allyList.substring(0, allyList.length() - 2); }
|
||||
if (enemyList.endsWith(", ")) { enemyList = enemyList.substring(0, enemyList.length() - 2); }
|
||||
|
||||
sendMessage(allyList);
|
||||
sendMessage(enemyList);
|
||||
sendMessage(allyList); sendMessage(enemyList);
|
||||
|
||||
// List the members...
|
||||
String onlineList = p.txt.parse("<a>") + "Members online: ";
|
||||
String offlineList = p.txt.parse("<a>") + "Members offline: ";
|
||||
for (FPlayer follower : admins) {
|
||||
String offlineList = p.txt.parse("<a>") + "Members offline: "; for (FPlayer follower : admins) {
|
||||
listpart = follower.getNameAndTitle(fme) + p.txt.parse("<i>") + ", ";
|
||||
if (follower.isOnlineAndVisibleTo(me)) {
|
||||
onlineList += listpart;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
offlineList += listpart;
|
||||
}
|
||||
}
|
||||
for (FPlayer follower : mods) {
|
||||
listpart = follower.getNameAndTitle(fme) + p.txt.parse("<i>") + ", ";
|
||||
if
|
||||
(follower.isOnlineAndVisibleTo(me)) {
|
||||
onlineList += listpart;
|
||||
}
|
||||
else {
|
||||
offlineList += listpart;
|
||||
}
|
||||
}
|
||||
for (FPlayer follower : normals) {
|
||||
} for (FPlayer follower : mods) {
|
||||
listpart = follower.getNameAndTitle(fme) + p.txt.parse("<i>") + ", ";
|
||||
if (follower.isOnlineAndVisibleTo(me)) {
|
||||
onlineList += listpart;
|
||||
} else {
|
||||
offlineList += listpart;
|
||||
}
|
||||
else {
|
||||
} for (FPlayer follower : normals) {
|
||||
listpart = follower.getNameAndTitle(fme) + p.txt.parse("<i>") + ", ";
|
||||
if (follower.isOnlineAndVisibleTo(me)) {
|
||||
onlineList += listpart;
|
||||
} else {
|
||||
offlineList += listpart;
|
||||
}
|
||||
}
|
||||
|
||||
if (onlineList.endsWith(", ")) {
|
||||
onlineList = onlineList.substring(0, onlineList.length() - 2);
|
||||
}
|
||||
if (offlineList.endsWith(", ")) {
|
||||
} if (offlineList.endsWith(", ")) {
|
||||
offlineList = offlineList.substring(0, offlineList.length() - 2);
|
||||
}
|
||||
|
||||
sendMessage(onlineList);
|
||||
sendMessage(offlineList);
|
||||
sendMessage(onlineList); sendMessage(offlineList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user