Package net.neoforged.neoforge.common
Class ModConfigSpec.ListValueSpec
java.lang.Object
net.neoforged.neoforge.common.ModConfigSpec.ValueSpec
net.neoforged.neoforge.common.ModConfigSpec.ListValueSpec
- Enclosing class:
ModConfigSpec
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ModConfigSpec.Range
<Integer> private final @Nullable Supplier
<?> private static final ModConfigSpec.Range
<Integer> private final @Nullable ModConfigSpec.Range
<Integer> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ListValueSpec
(Supplier<?> supplier, @Nullable Supplier<?> newElementSupplier, Predicate<Object> listValidator, Predicate<Object> elementValidator, ModConfigSpec.BuilderContext context, List<String> path, @Nullable ModConfigSpec.Range<Integer> sizeRange) -
Method Summary
Modifier and TypeMethodDescription@Nullable Supplier
<?> Creates a new empty element that can be added to the end of the list or null if the list doesn't support adding elements.The allowable range of the size of the list.boolean
testElement
(Object value) Determines if a given object can be part of the list.Methods inherited from class net.neoforged.neoforge.common.ModConfigSpec.ValueSpec
correct, getClazz, getComment, getDefault, getRange, getTranslationKey, restartType, test
-
Field Details
-
MAX_ELEMENTS
-
NON_EMPTY
-
newElementSupplier
-
sizeRange
-
elementValidator
-
-
Constructor Details
-
ListValueSpec
-
-
Method Details
-
getNewElementSupplier
Creates a new empty element that can be added to the end of the list or null if the list doesn't support adding elements.The element does not need to validate with either
ModConfigSpec.ValueSpec.test(Object)
ortestElement(Object)
, but it should give the user a good starting point for their edit.Only used by the UI!
-
testElement
Determines if a given object can be part of the list.Note that the list-level validator overrules this.
Only used by the UI!
-
getSizeRange
The allowable range of the size of the list.Note that the validator overrules this.
Only used by the UI!
-