mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-25 01:58:28 +01:00
Better feedback when trying to join a password protected party.
This commit is contained in:
parent
56e16acce4
commit
b91b88a74b
@ -176,7 +176,6 @@ public class PartyManager {
|
||||
*/
|
||||
public void removeFromParty(String playerName, Party party) {
|
||||
List<String> members = party.getMembers();
|
||||
List<Player> onlineMembers = party.getOnlineMembers();
|
||||
|
||||
members.remove(playerName);
|
||||
|
||||
@ -184,12 +183,10 @@ public class PartyManager {
|
||||
parties.remove(party);
|
||||
}
|
||||
else {
|
||||
//If the leaving player was the party leader, appoint a new leader from the online party members
|
||||
//If the leaving player was the party leader, appoint a new leader from the party members
|
||||
if (party.getLeader().equals(playerName)) {
|
||||
if (!onlineMembers.isEmpty()) {
|
||||
Player newLeader = onlineMembers.get(0);
|
||||
party.setLeader(newLeader.getName());
|
||||
}
|
||||
String newLeader = members.get(0);
|
||||
party.setLeader(newLeader);
|
||||
}
|
||||
|
||||
informPartyMembersQuit(playerName, party);
|
||||
@ -309,7 +306,8 @@ public class PartyManager {
|
||||
|
||||
if (partyPassword != null) {
|
||||
if (password == null) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Help.1"));
|
||||
player.sendMessage(LocaleLoader.getString("Party.Password.None"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Usage.3", new Object[] {"party", "join", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">", "<" + LocaleLoader.getString("Commands.Usage.Password") + ">"}));
|
||||
return false;
|
||||
}
|
||||
else if (!password.equals(partyPassword)) {
|
||||
|
@ -509,6 +509,7 @@ Party.NotOwner=[[DARK_RED]]You are not the party leader.
|
||||
Party.Owner.New=[[GREEN]]{0} is the new party leader.
|
||||
Party.Owner.NotLeader=[[DARK_RED]]You are no longer the party leader.
|
||||
Party.Owner.Player =[[GREEN]]You are now the party leader.
|
||||
Party.Password.None=[[RED]]This party is password protected.
|
||||
Party.Password.Incorrect=[[RED]]Party password is incorrect.
|
||||
Party.NotOnline=[[DARK_RED]]{0} is not online!
|
||||
Party.PasswordSet=[[GREEN]]Party password set to {0}
|
||||
|
Loading…
Reference in New Issue
Block a user