We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As the title suggests. It is inconvenient when handling a large set of similar options and requires a lot of duplication and hard coding.
I found a solution. In DefaultGuiProviders.java:
private static List<AbstractConfigListEntry> getChildren(String i18n, Class<?> fieldType, Object iConfig, Object iDefaults, GuiRegistryAccess guiProvider) { - return Arrays.stream(fieldType.getDeclaredFields()) + return traverseFields(fieldType, true).stream()
where traverseFields is a new helper function:
traverseFields
private static List<Field> traverseFields(Class<?> fieldType, boolean includeSuper) { List<Field> result = new LinkedList<>(); Class<?> cls = fieldType; while (cls != null && !cls.equals(Object.class)) { result.addAll(Arrays.asList(cls.getDeclaredFields())); if (!includeSuper) { break; } cls = cls.getSuperclass(); } return result; }
We could introduce another option in the CollapsibleObject annotation to specify whether we include the fields in its super class or not.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As the title suggests. It is inconvenient when handling a large set of similar options and requires a lot of duplication and hard coding.
I found a solution. In DefaultGuiProviders.java:
where
traverseFields
is a new helper function:We could introduce another option in the CollapsibleObject annotation to specify whether we include the fields in its super class or not.
The text was updated successfully, but these errors were encountered: