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

Method getField

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

Gets the value stored in a field in the wrapped object @param name The name of the field @param supers The number of superclasses to move up before getting the declared field @return A wrapped NMSObject with the value of the field

(int supers, String name)

Source from the content-addressed store, hash-verified

86 * @return A wrapped NMSObject with the value of the field
87 */
88 public NMSObject getField(int supers, String name) {
89 try {
90 Field field = getSuperclass(obj.getClass(), supers).getDeclaredField(name);
91 field.setAccessible(true);
92 return new NMSObject(field.get(obj));
93 } catch (IllegalAccessException | NoSuchFieldException e) {
94 throw new IllegalArgumentException(e);
95 }
96 }
97
98 /**
99 * Gets the value stored in a field in the wrapped object

Callers

nothing calls this directly

Calls 3

getSuperclassMethod · 0.95
getClassMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected