From 3a3d5cd4fb2fd83e9813a23664b4617c3f4e92bd Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Sat, 21 Jun 2014 19:03:39 +0200 Subject: [PATCH] DisplayName per Beholder --- .../massivecraft/factions/cmd/CmdFactionsDescription.java | 6 +++++- src/com/massivecraft/factions/cmd/CmdFactionsDisband.java | 3 ++- src/com/massivecraft/factions/cmd/CmdFactionsKick.java | 3 ++- src/com/massivecraft/factions/entity/UPlayer.java | 2 +- src/com/massivecraft/factions/entity/UPlayerColl.java | 3 ++- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java b/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java index ec653f7f..7b17d423 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java @@ -5,6 +5,7 @@ import com.massivecraft.factions.Rel; import com.massivecraft.factions.cmd.req.ReqFactionsEnabled; import com.massivecraft.factions.cmd.req.ReqHasFaction; import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.event.EventFactionsDescriptionChange; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.mixin.Mixin; @@ -51,7 +52,10 @@ public class CmdFactionsDescription extends FCommand usenderFaction.setDescription(newDescription); // Inform - usenderFaction.msg("%s set your faction description to:\n%s", Mixin.getDisplayName(sender), usenderFaction.getDescription()); + for (UPlayer follower : usenderFaction.getUPlayers()) + { + follower.msg("%s set your faction description to:\n%s", Mixin.getDisplayName(sender, follower), usenderFaction.getDescription()); + } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java index d3f63ad3..801e5589 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java @@ -15,6 +15,7 @@ import com.massivecraft.factions.FPerm; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsDisband extends FCommand @@ -87,7 +88,7 @@ public class CmdFactionsDisband extends FCommand if (MConf.get().logFactionDisband) { - Factions.get().log(Txt.parse("The faction %s (%s) was disbanded by %s.", faction.getName(), faction.getId(), usender.getDisplayName())); + Factions.get().log(Txt.parse("The faction %s (%s) was disbanded by %s.", faction.getName(), faction.getId(), usender.getDisplayName(IdUtil.getConsole()))); } faction.detach(); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java index 97fbab0f..a1c6f955 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java @@ -14,6 +14,7 @@ import com.massivecraft.factions.entity.UConf; import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; +import com.massivecraft.massivecore.util.IdUtil; public class CmdFactionsKick extends FCommand { @@ -84,7 +85,7 @@ public class CmdFactionsKick extends FCommand if (MConf.get().logFactionKick) { - Factions.get().log(usender.getDisplayName() + " kicked " + uplayer.getName() + " from the faction " + uplayerFaction.getName()); + Factions.get().log(usender.getDisplayName(IdUtil.getConsole()) + " kicked " + uplayer.getName() + " from the faction " + uplayerFaction.getName()); } // Apply diff --git a/src/com/massivecraft/factions/entity/UPlayer.java b/src/com/massivecraft/factions/entity/UPlayer.java index 7840561c..76de08f4 100644 --- a/src/com/massivecraft/factions/entity/UPlayer.java +++ b/src/com/massivecraft/factions/entity/UPlayer.java @@ -260,7 +260,7 @@ public class UPlayer extends SenderEntity implements EconomyParticipato factionNameDesc = faction.getName(); } - Factions.get().log(Txt.parse("setFactionId moved %s aka %s from %s aka %s to %s aka %s.", this.getId(), Mixin.getDisplayName(this.getId()), oldFactionIdDesc, oldFactionNameDesc, factionIdDesc, factionNameDesc)); + Factions.get().log(Txt.parse("setFactionId moved %s aka %s from %s aka %s to %s aka %s.", this.getId(), this.getDisplayName(IdUtil.getConsole()), oldFactionIdDesc, oldFactionNameDesc, factionIdDesc, factionNameDesc)); // Mark as changed this.changed(); diff --git a/src/com/massivecraft/factions/entity/UPlayerColl.java b/src/com/massivecraft/factions/entity/UPlayerColl.java index bfbfc726..5f94fe8f 100644 --- a/src/com/massivecraft/factions/entity/UPlayerColl.java +++ b/src/com/massivecraft/factions/entity/UPlayerColl.java @@ -5,6 +5,7 @@ import com.massivecraft.factions.Rel; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.store.MStore; import com.massivecraft.massivecore.store.SenderColl; +import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.TimeUnit; import com.massivecraft.massivecore.util.Txt; @@ -34,7 +35,7 @@ public class UPlayerColl extends SenderColl uplayer.resetFactionData(); - String message = Txt.parse("Reset data for %s in %s universe. Unknown factionId %s", uplayer.getDisplayName(), universe, factionId); + String message = Txt.parse("Reset data for %s in %s universe. Unknown factionId %s", uplayer.getDisplayName(IdUtil.getConsole()), universe, factionId); Factions.get().log(message); } }