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

Method getInstance

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

Calls a constructor of this class with the given arguments @param args The arguments to pass to the constructor @return An NMSObject wrapping the returned value

(Object... args)

Source from the content-addressed store, hash-verified

51 * @return An NMSObject wrapping the returned value
52 */
53 public NMSObject getInstance(Object... args) {
54 try {
55 NMSHelper.unwrapArgs(args);
56 return new NMSObject(NMSHelper.getConstructor(clazz, NMSHelper.getArgTypes(args)).newInstance(args));
57 } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
58 throw new IllegalArgumentException(e);
59 }
60 }
61
62 /**
63 * Creates an array of this class type

Callers 1

onBreakMethod · 0.45

Calls 3

unwrapArgsMethod · 0.95
getConstructorMethod · 0.95
getArgTypesMethod · 0.95

Tested by

no test coverage detected