mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Make overloads consistent for defineListAllowEmpty in ForgeConfigSpec.Builder (#9604)
This commit is contained in:
1 parent
72e2ae1d6f
commit
c0fe1688d8
2 files changed
+10
-2
No files matched your search
@@ -380,7 +380,15 @@ public class ForgeConfigSpec extends UnmodifiableConfigWrapper<UnmodifiableConfi
|
||||
}
|
||||
}, defaultSupplier);
|
||||
}
|
||||
|
||||
public <T> ConfigValue<List<? extends T>> defineListAllowEmpty(String path, List<? extends T> defaultValue, Predicate<Object> elementValidator) {
|
||||
return defineListAllowEmpty(split(path), defaultValue, elementValidator);
|
||||
}
|
||||
public <T> ConfigValue<List<? extends T>> defineListAllowEmpty(String path, Supplier<List<? extends T>> defaultSupplier, Predicate<Object> elementValidator) {
|
||||
return defineListAllowEmpty(split(path), defaultSupplier, elementValidator);
|
||||
}
|
||||
public <T> ConfigValue<List<? extends T>> defineListAllowEmpty(List<String> path, List<? extends T> defaultValue, Predicate<Object> elementValidator) {
|
||||
return defineListAllowEmpty(path, () -> defaultValue, elementValidator);
|
||||
}
|
||||
public <T> ConfigValue<List<? extends T>> defineListAllowEmpty(List<String> path, Supplier<List<? extends T>> defaultSupplier, Predicate<Object> elementValidator) {
|
||||
context.setClazz(List.class);
|
||||
return define(path, new ValueSpec(defaultSupplier, x -> x instanceof List && ((List<?>) x).stream().allMatch( elementValidator ), context, path) {
|
||||
|
||||
Reference in new issue
Block a user