MCPcopy Create free account
hub / github.com/boxbeam/RedLib / callMethod

Method callMethod

src/redempt/redlib/nms/NMSObject.java:61–68  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

getMethodMethod · 0.95
getSuperclassMethod · 0.95
getArgTypesMethod · 0.95
getClassMethod · 0.80
invokeMethod · 0.80

Tested by

no test coverage detected