mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 08:39:49 +01:00
Cleanup, no need for this in PartyManager
This commit is contained in:
parent
473b9e8bbe
commit
f1075f800f
@ -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.
|
||||
*
|
||||
|
@ -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}));
|
||||
|
Loading…
Reference in New Issue
Block a user