Class CodecType<T>

java.lang.Object
net.ixdarklord.coolcatcore.api.config.type.CodecType<T>
All Implemented Interfaces:
ConfigType<T>

public final class CodecType<T> extends Object implements ConfigType<T>
Any value with a Codec: records, maps, item stacks... Edited as JSON in the config screen. The optional validator returns an error message, or null for a valid value.
  • Method Details

    • codec

      public com.mojang.serialization.Codec<T> codec()
      Specified by:
      codec in interface ConfigType<T>
    • validate

      public ValidationResult<T> validate(T value)
      Description copied from interface: ConfigType
      Checks a value, possibly correcting it.
      Specified by:
      validate in interface ConfigType<T>
    • describe

      public List<net.minecraft.network.chat.Component> describe()
      Description copied from interface: ConfigType
      The constraints in words, for the file's comments and the screen's tooltips ("Range: 0 ~ 10").
      Specified by:
      describe in interface ConfigType<T>