From f1075f800fc4b9c3ea44ae9f5946597bbe6091c5 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sat, 26 Jan 2013 19:40:20 +0100 Subject: [PATCH] Cleanup, no need for this in PartyManager --- .../com/gmail/nossr50/party/PartyManager.java | 15 --------------- .../nossr50/party/commands/PartyCommand.java | 6 +++++- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/party/PartyManager.java b/src/main/java/com/gmail/nossr50/party/PartyManager.java index 171131033..c59fea659 100644 --- a/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -86,21 +86,6 @@ public class PartyManager { } } - /** - * Notify party members when the party leader changed the party name. - * - * @param newPartyName The new name of the party - * @param party The concerned party - */ - public void informPartyMembersNameChange(String newPartyName, Party party) { - String leader = party.getLeader(); - for (Player member : party.getOnlineMembers()) { - if (!member.getName().equals(leader)) { - member.sendMessage(LocaleLoader.getString("Party.InformedOnNameChange", new Object[] {leader, newPartyName})); - } - } - } - /** * Get a list of all players in this player's party. * diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyCommand.java index dad495953..e4bf94a19 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyCommand.java @@ -564,6 +564,7 @@ public class PartyCommand implements CommandExecutor { PartyManager partyManagerInstance = PartyManager.getInstance(); Party party = playerProfile.getParty(); + String leader = party.getLeader(); if (party.getLeader().equals(playerName)) { if(args.length < 2) { @@ -586,8 +587,11 @@ public class PartyCommand implements CommandExecutor { if (event.isCancelled()) { return true; } + + if (!onlineMembers.getName().equals(leader)) { + onlineMembers.sendMessage(LocaleLoader.getString("Party.InformedOnNameChange", new Object[] {leader, newPartyName})); + } } - partyManagerInstance.informPartyMembersNameChange(newPartyName, party); party.setName(newPartyName); } player.sendMessage(LocaleLoader.getString("Commands.Party.Rename", new Object[] {newPartyName}));