Class ConfigTypes
java.lang.Object
net.ixdarklord.coolcatcore.api.config.type.ConfigTypes
The built-in
ConfigTypes. The ConfigBuilder makes these for
single values; use them directly for list elements: builder.list("ids", ConfigTypes.intRange(0, 9), List.of(1)).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BooleanTypestatic final ColorTypeAn opaque#RRGGBBcolor.static final ColorTypeA#AARRGGBBcolor.static final NumberType<Double>static final NumberType<Float>static final IdentifierTypestatic final NumberType<Integer>static final NumberType<Long>static final StringType -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CodecType<T>codec(com.mojang.serialization.Codec<T> codec) Any codec's values, edited as JSON.static <T> CodecType<T>codec(com.mojang.serialization.Codec<T> codec, Function<T, net.minecraft.network.chat.Component> validator, net.minecraft.network.chat.Component... description) Any codec's values, checked by a validator returning an error message, or null for a valid value.static NumberType<Double>doubleRange(double min, double max) static NumberType<Float>floatRange(float min, float max) static IdentifierTypeidentifier(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> registry) An id whose suggestions come from a built-in registry, likeRegistries.ITEM.static NumberType<Integer>intRange(int min, int max) static <E> ListType<E>listOf(ConfigType<E> elementType) static <E> ListType<E>listOf(ConfigType<E> elementType, int minSize, int maxSize) static NumberType<Long>longRange(long min, long max) static StringTypeText matching a regular expression as a whole.static StringTypestring(int maxLength)
-
Field Details
-
BOOLEAN
-
INT
-
LONG
-
FLOAT
-
DOUBLE
-
STRING
-
COLOR
An opaque#RRGGBBcolor. -
COLOR_ALPHA
A#AARRGGBBcolor. -
IDENTIFIER
-
-
Method Details
-
intRange
-
longRange
-
floatRange
-
doubleRange
-
string
-
pattern
Text matching a regular expression as a whole. -
enumOf
-
identifier
public static IdentifierType identifier(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> registry) An id whose suggestions come from a built-in registry, likeRegistries.ITEM. -
listOf
-
listOf
-
codec
Any codec's values, edited as JSON. -
codec
public static <T> CodecType<T> codec(com.mojang.serialization.Codec<T> codec, Function<T, net.minecraft.network.chat.Component> validator, net.minecraft.network.chat.Component... description) Any codec's values, checked by a validator returning an error message, or null for a valid value.
-