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

Method callStaticMethod

src/redempt/redlib/nms/NMSClass.java:79–86  ·  view source on GitHub ↗

Calls a static method of this class @param methodName The name of the static method @param args The arguments to pass to the static method @return An NMSObject wrapping the returned value from the method

(String methodName, Object... args)

Source from the content-addressed store, hash-verified

77 * @return An NMSObject wrapping the returned value from the method
78 */
79 public NMSObject callStaticMethod(String methodName, Object... args) {
80 try {
81 Method method = NMSHelper.getMethod(clazz, methodName, NMSHelper.getArgTypes(args));
82 return new NMSObject(method.invoke(null, args));
83 } catch (IllegalAccessException | InvocationTargetException e) {
84 throw new IllegalArgumentException(e);
85 }
86 }
87
88 /**
89 * Gets the value of a static field in the wrapped class

Callers

nothing calls this directly

Calls 3

getMethodMethod · 0.95
getArgTypesMethod · 0.95
invokeMethod · 0.80

Tested by

no test coverage detected