Auto generate a simple Config Screen

This commit is contained in:
Frank 2021-08-20 14:37:40 +02:00
parent d31425623d
commit 092e0a39e8
3 changed files with 33 additions and 6 deletions

View file

@ -28,13 +28,11 @@ public class NamedPathConfig extends PathConfig{
public Bool(boolean def, String entry, ResourceLocation path) { super(entry, path); this.defaultValue=def;}
}
public static class Str extends ConfigToken{
public final String defaultValue;
public Str(String def, String entry, String... path) { super(entry, path); this.defaultValue=def;}
public Str(String def, String entry, ResourceLocation path) { super(entry, path); this.defaultValue=def;}
}
ConfigToken(String entry, String... path) { super(entry, path); }
ConfigToken(String entry, ResourceLocation path) { super(entry, path); }
}
@ -54,7 +52,7 @@ public class NamedPathConfig extends PathConfig{
onInit();
}
List<ConfigToken> getAllOptions(){
public List<ConfigToken> getAllOptions(){
List<ConfigToken> res = new LinkedList<>();
for (Field fl : this.getClass().getDeclaredFields()){
int modifiers = fl.getModifiers();