Hi, I'm trying to receive the data from the tablist, most notably the footer and header.
Here is the method I am using to obtain the private fields. I try to check for both the forge name and vanilla:
private String getPrivateStringFieldFromObject(Object object, String forgeFieldName, String vanillaFieldName)
throws NoSuchFieldException, SecurityException, IllegalArgumentException,
IllegalAccessException {
Field targetField = null;
try {
targetField = object.getClass().getDeclaredField(forgeFieldName);
} catch (NoSuchFieldException e) {
targetField = object.getClass().getDeclaredField(vanillaFieldName);
}
if (targetField != null) {
targetField.setAccessible(true);
return String.valueOf(targetField.get(object).toString()).toString();
} else {
return "";
}
}
Here is the call that I use:
getPrivateStringFieldFromObject(minecraft.ingameGUI.getTabList().getClass(), "footer", "field_175255_h")
however I get java.lang.NoSuchFieldException after catching the first one. I don't see how I'm not getting the footer.