File tree Expand file tree Collapse file tree
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/reflection Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments