Fix default GUIConfig displaying child categories twice (#4599)

This commit is contained in:
Justin 2018-01-18 13:03:37 -08:00 committed by LexManos
parent 01f573dbaa
commit ff8ba90da3
2 changed files with 15 additions and 0 deletions

View File

@ -396,6 +396,8 @@ public class ConfigElement implements IConfigElement
if (catName.isEmpty())
continue;
ConfigCategory category = config.getCategory(catName);
if (category.isChild())
continue;
DummyCategoryElement element = new DummyCategoryElement(category.getName(), category.getLanguagekey(), new ConfigElement(category).getChildElements());
element.setRequiresMcRestart(category.requiresMcRestart());
element.setRequiresWorldRestart(category.requiresWorldRestart());

View File

@ -130,6 +130,8 @@ public class ConfigTest
public static SubCat sub1 = new SubCat("Hello");
@Name("test_b")
public static SubCat sub2 = new SubCat("Goodbye");
@Name("test_c")
public static SubCat2 sub3 = new SubCat2("Hi");
public static class SubCat
{
@ -141,6 +143,17 @@ public class ConfigTest
this.value = value;
}
}
public static class SubCat2
{
@Name("child_cat")
public SubCat child;
public SubCat2(String value)
{
this.child = new SubCat(value);
}
}
}
@LangKey("config_test.config.maps")