Calls a method on the wrapped object @param name The name of the method @param args The arguments to pass to the method @param supers The number of superclasses to move up before getting the declared method @return An NMSObject which is the returned value from the method
(int supers, String name, Object... args)
| 59 | * @return An NMSObject which is the returned value from the method |
| 60 | */ |
| 61 | public NMSObject callMethod(int supers, String name, Object... args) { |
| 62 | try { |
| 63 | Method method = NMSHelper.getMethod(getSuperclass(obj.getClass(), supers), name, NMSHelper.getArgTypes(args)); |
| 64 | return new NMSObject(method.invoke(obj, args)); |
| 65 | } catch (IllegalAccessException | InvocationTargetException e) { |
| 66 | throw new IllegalArgumentException(e); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Calls a method on the wrapped object |
nothing calls this directly
no test coverage detected