api: modify RemoveFriend to accept a nameable
Also update javadoc to reflect that it now also includes ignores
This commit is contained in:
@@ -25,15 +25,16 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
|
import net.runelite.api.Nameable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a request to remove a friend is sent to the server.
|
* An event trigger when a player is removed from the friend or ignore list.
|
||||||
*/
|
*/
|
||||||
@Value
|
@Value
|
||||||
public class RemovedFriend
|
public class RemovedFriend
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The name of the removed friend.
|
* The removed friend or ignore entry
|
||||||
*/
|
*/
|
||||||
private final String name;
|
private final Nameable nameable;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ public class FriendNotesPlugin extends Plugin
|
|||||||
public void onRemovedFriend(RemovedFriend event)
|
public void onRemovedFriend(RemovedFriend event)
|
||||||
{
|
{
|
||||||
// Delete a friend's note if they are removed
|
// Delete a friend's note if they are removed
|
||||||
final String displayName = Text.toJagexName(event.getName());
|
final String displayName = Text.toJagexName(event.getNameable().getName());
|
||||||
log.debug("Remove friend: '{}'", displayName);
|
log.debug("Remove friend: '{}'", displayName);
|
||||||
setFriendNote(displayName, null);
|
setFriendNote(displayName, null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user