hey everyone, im trying to make it so players are unable to add staff members to the ignore list ...
this is what i tried:
Code:
public void add(long name) {
Player ignore = PlayerHandler.getPlayerByLongName(name);
if(has(name) == (client.getRights().getValue() >= 1 && client.getRights().getValue() <= 3)) {
getIgnores().remove(name);
if (ignore != null && ignore.getFriends().has(client.getNameAsLong())) {
ignore.getPA().sendFriend(client.getNameAsLong(), (byte) 1);
}
return;
}
if (getIgnores().size() >= 100) {
client.sendMessage("Your ignore list is full.");
return;
}
if (client.getFriends().has(name)) {
client.sendMessage("Please remove that player from your friends list first.");
return;
}
if (has(name)) {
client.sendMessage("That player is already on your ignore list.");
return;
}
getIgnores().add(name);
if (client.getPrivateChat() == Friends.ONLINE) {
if (ignore != null && ignore.getFriends().has(client.getNameAsLong())) {
ignore.getPA().sendFriend(client.getNameAsLong(), (byte) 0);
}
}
}