Cleanup, no need for this in PartyManager

This commit is contained in:
TfT_02 2013-01-26 19:40:20 +01:00
parent 473b9e8bbe
commit f1075f800f
2 changed files with 5 additions and 16 deletions

View File

@ -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. * Get a list of all players in this player's party.
* *

View File

@ -564,6 +564,7 @@ public class PartyCommand implements CommandExecutor {
PartyManager partyManagerInstance = PartyManager.getInstance(); PartyManager partyManagerInstance = PartyManager.getInstance();
Party party = playerProfile.getParty(); Party party = playerProfile.getParty();
String leader = party.getLeader();
if (party.getLeader().equals(playerName)) { if (party.getLeader().equals(playerName)) {
if(args.length < 2) { if(args.length < 2) {
@ -586,8 +587,11 @@ public class PartyCommand implements CommandExecutor {
if (event.isCancelled()) { if (event.isCancelled()) {
return true; return true;
} }
if (!onlineMembers.getName().equals(leader)) {
onlineMembers.sendMessage(LocaleLoader.getString("Party.InformedOnNameChange", new Object[] {leader, newPartyName}));
}
} }
partyManagerInstance.informPartyMembersNameChange(newPartyName, party);
party.setName(newPartyName); party.setName(newPartyName);
} }
player.sendMessage(LocaleLoader.getString("Commands.Party.Rename", new Object[] {newPartyName})); player.sendMessage(LocaleLoader.getString("Commands.Party.Rename", new Object[] {newPartyName}));