Class ConfigTypes

java.lang.Object
net.ixdarklord.coolcatcore.api.config.type.ConfigTypes

public final class ConfigTypes extends Object
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 Details

  • Method Details

    • intRange

      public static NumberType<Integer> intRange(int min, int max)
    • longRange

      public static NumberType<Long> longRange(long min, long max)
    • floatRange

      public static NumberType<Float> floatRange(float min, float max)
    • doubleRange

      public static NumberType<Double> doubleRange(double min, double max)
    • string

      public static StringType string(int maxLength)
    • pattern

      public static StringType pattern(String regex)
      Text matching a regular expression as a whole.
    • enumOf

      public static <E extends Enum<E>> EnumType<E> enumOf(Class<E> enumClass)
    • 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, like Registries.ITEM.
    • listOf

      public static <E> ListType<E> listOf(ConfigType<E> elementType)
    • listOf

      public static <E> ListType<E> listOf(ConfigType<E> elementType, int minSize, int maxSize)
    • codec

      public static <T> CodecType<T> codec(com.mojang.serialization.Codec<T> 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.