api: add npc accessor to menuentry

This commit is contained in:
Adam
2022-05-23 17:15:22 -04:00
parent c64fc72f9e
commit 7a1d958ee0
16 changed files with 78 additions and 82 deletions

View File

@@ -122,4 +122,11 @@ public interface MenuEntry
*/
@Nullable
Widget getWidget();
/**
* Get the {@link NPC} this menu entry is targeting, if any.
* @return
*/
@Nullable
NPC getNpc();
}

View File

@@ -25,6 +25,7 @@
package net.runelite.api.events;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import net.runelite.api.MenuEntry;
@@ -37,6 +38,7 @@ import net.runelite.api.MenuEntry;
@ToString(onlyExplicitlyIncluded = true)
public class MenuEntryAdded
{
@Getter
private final MenuEntry menuEntry;
/**

View File

@@ -52,6 +52,7 @@ public class MenuOptionClicked
/**
* The clicked menu entry
*/
@Getter
private final MenuEntry menuEntry;
/**