From 686986eeb9f1232230066484494737db113c57df Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 24 Nov 2011 16:53:59 +0100 Subject: [PATCH] Fixes to the show command. --- src/com/massivecraft/factions/Faction.java | 4 ++-- src/com/massivecraft/factions/cmd/CmdShow.java | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/com/massivecraft/factions/Faction.java b/src/com/massivecraft/factions/Faction.java index bea8e785..a82a59b0 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -252,7 +252,7 @@ public class Faction extends Entity implements EconomyParticipator } } - public Map> getFactionTagsPerRelation() + public Map> getFactionTagsPerRelation(RelationParticipator rp) { Map> ret = new HashMap>(); for (Rel rel : Rel.values()) @@ -262,7 +262,7 @@ public class Faction extends Entity implements EconomyParticipator for (Faction faction : Factions.i.get()) { Rel relation = faction.getRelationTo(this); - ret.get(relation).add(faction.getTag(this)); + ret.get(relation).add(faction.getTag(rp)); } return ret; } diff --git a/src/com/massivecraft/factions/cmd/CmdShow.java b/src/com/massivecraft/factions/cmd/CmdShow.java index 1c2d5359..4caeb6e1 100644 --- a/src/com/massivecraft/factions/cmd/CmdShow.java +++ b/src/com/massivecraft/factions/cmd/CmdShow.java @@ -57,12 +57,12 @@ public class CmdShow extends FCommand // TODO: Find the non default flags, and display them instead. if (faction.getFlag(FFlag.PERMANENT)) { - msg("This faction is permanent, remaining even with no members."); + msg("This faction is permanent - remaining even with no members."); } if (faction.getFlag(FFlag.PEACEFUL)) { - sendMessage(Conf.colorTruce+"This faction is peaceful - in truce with everyone."); + msg("This faction is peaceful - in truce with everyone."); } msg("Joining: "+(faction.getOpen() ? "no invitation is needed" : "invitation is required")); @@ -90,8 +90,17 @@ public class CmdShow extends FCommand String sepparator = p.txt.parse("")+", "; // List the relations to other factions - Map> relationTags = faction.getFactionTagsPerRelation(); - sendMessage(p.txt.parse("In Truce with: ") + TextUtil.implode(relationTags.get(Rel.TRUCE), sepparator)); + Map> relationTags = faction.getFactionTagsPerRelation(fme); + + if (faction.getFlag(FFlag.PEACEFUL)) + { + sendMessage(p.txt.parse("In Truce with: *everyone*")); + } + else + { + sendMessage(p.txt.parse("In Truce with: ") + TextUtil.implode(relationTags.get(Rel.TRUCE), sepparator)); + } + sendMessage(p.txt.parse("Allied to: ") + TextUtil.implode(relationTags.get(Rel.ALLY), sepparator)); sendMessage(p.txt.parse("Enemies: ") + TextUtil.implode(relationTags.get(Rel.ENEMY), sepparator));