mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Add hasMember methods
This commit is contained in:
parent
cc2c2c3254
commit
e8b54cd537
@ -22,7 +22,7 @@ public class PartyChangeOwnerCommand implements CommandExecutor {
|
|||||||
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
||||||
OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(targetName);
|
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));
|
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public class PartyKickCommand implements CommandExecutor {
|
|||||||
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
|
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||||
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
||||||
|
|
||||||
if (!playerParty.getMembers().keySet().contains(targetName)) {
|
if (!playerParty.hasMember(targetName)) {
|
||||||
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
|
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -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<Player> nearMembers) {
|
public String createMembersList(String playerName, List<Player> nearMembers) {
|
||||||
StringBuilder memberList = new StringBuilder();
|
StringBuilder memberList = new StringBuilder();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user