Skip to content

Commit acaef00

Browse files
authored
Merge pull request #290 from chsami/development
Development into main
2 parents 3c53c0a + 7720d3f commit acaef00

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/reflection

runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/reflection/Rs2Reflection.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ public static String[] getGroundItemActions(ItemComposition item) {
8282

8383
@SneakyThrows
8484
public static void setItemId(MenuEntry menuEntry, int itemId) throws IllegalAccessException, InvocationTargetException {
85-
Arrays.stream(menuEntry.getClass().getMethods())
86-
.filter(x -> x.getReturnType().getName().equals("void") && x.getParameters().length > 0 && x.getParameters()[0].getType().getName().equals("int"))
87-
.collect(Collectors.toList())
88-
.get(0)
85+
var list = Arrays.stream(menuEntry.getClass().getMethods())
86+
.filter(x -> x.getName().equals("setItemId"))
87+
.collect(Collectors.toList());
88+
89+
list.get(0)
8990
.invoke(menuEntry, itemId); //use the setItemId method through reflection
9091
}
9192

0 commit comments

Comments
 (0)