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}));