diff --git a/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java index d81cc4c39..2b822bcfb 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java @@ -22,7 +22,7 @@ public class PartyChangeOwnerCommand implements CommandExecutor { String targetName = CommandUtils.getMatchedPlayerName(args[1]); OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(targetName); - if (!playerParty.getMembers().values().contains(target.getUniqueId())) { + if (!playerParty.hasMember(target.getUniqueId())) { sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName)); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java index ea782a9b5..c9afa3369 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java @@ -22,7 +22,7 @@ public class PartyKickCommand implements CommandExecutor { Party playerParty = UserManager.getPlayer((Player) sender).getParty(); String targetName = CommandUtils.getMatchedPlayerName(args[1]); - if (!playerParty.getMembers().keySet().contains(targetName)) { + if (!playerParty.hasMember(targetName)) { sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName)); return true; } diff --git a/src/main/java/com/gmail/nossr50/datatypes/party/Party.java b/src/main/java/com/gmail/nossr50/datatypes/party/Party.java index 038c0b65e..4dd9f0532 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/party/Party.java +++ b/src/main/java/com/gmail/nossr50/datatypes/party/Party.java @@ -306,6 +306,14 @@ public class Party { } } + public boolean hasMember(String memberName) { + return this.getMembers().keySet().contains(memberName); + } + + public boolean hasMember(UUID uuid) { + return this.getMembers().values().contains(uuid); + } + public String createMembersList(String playerName, List nearMembers) { StringBuilder memberList = new StringBuilder();