Remove hack to force enum configs to strings

This commit is contained in:
tterrag 2019-04-16 00:16:57 -04:00
parent f30d7bc845
commit cb3ff19801

View file

@ -362,12 +362,7 @@ public class ForgeConfigSpec extends UnmodifiableConfigWrapper<Config>
}
public <V extends Enum<V>> EnumValue<V> defineEnum(List<String> path, Supplier<V> defaultSupplier, EnumGetMethod converter, Predicate<Object> validator, Class<V> clazz) {
context.setClazz(clazz);
return new EnumValue<V>(this, define(path, new ValueSpec(defaultSupplier, validator, context) {
@Override
public Object correct(Object value) {
return ((Enum<?>)super.correct(value)).name();
}
}, defaultSupplier).getPath(), defaultSupplier, converter, clazz);
return new EnumValue<V>(this, define(path, new ValueSpec(defaultSupplier, validator, context), defaultSupplier).getPath(), defaultSupplier, converter, clazz);
}
//boolean