From b91b88a74bc0cd2999787cf90f8d63f764626f93 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sat, 26 Jan 2013 15:38:57 +0100 Subject: [PATCH] Better feedback when trying to join a password protected party. --- .../java/com/gmail/nossr50/party/PartyManager.java | 12 +++++------- src/main/resources/locale/locale_en_US.properties | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/party/PartyManager.java b/src/main/java/com/gmail/nossr50/party/PartyManager.java index 0cfcbe637..c59fea659 100644 --- a/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -176,7 +176,6 @@ public class PartyManager { */ public void removeFromParty(String playerName, Party party) { List members = party.getMembers(); - List 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)) { diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 081858de6..b8cc5e3fd 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -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}