Class IdentifierType

java.lang.Object
net.ixdarklord.coolcatcore.api.config.type.IdentifierType
All Implemented Interfaces:
ConfigType<net.minecraft.resources.ResourceLocation>

public final class IdentifierType extends Object implements ConfigType<net.minecraft.resources.ResourceLocation>
A namespaced id (minecraft:stone). With a registry, commands and the screen suggest its entries.

Ids aren't checked against the registry: configs load before other mods register their content, and a data-driven registry only exists in a world. Check with the registry where the id is used.

  • Method Details

    • registry

      @Nullable public @Nullable net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> registry()
      The registry whose entries are suggested, if any.
    • codec

      public com.mojang.serialization.Codec<net.minecraft.resources.ResourceLocation> codec()
      Specified by:
      codec in interface ConfigType<net.minecraft.resources.ResourceLocation>
    • validate

      public ValidationResult<net.minecraft.resources.ResourceLocation> validate(net.minecraft.resources.ResourceLocation value)
      Description copied from interface: ConfigType
      Checks a value, possibly correcting it.
      Specified by:
      validate in interface ConfigType<net.minecraft.resources.ResourceLocation>
    • parse

      public ValidationResult<net.minecraft.resources.ResourceLocation> parse(String text)
      Description copied from interface: ConfigType
      Reads a value typed by a player, and validates it. By default the text is JSON for the codec.
      Specified by:
      parse in interface ConfigType<net.minecraft.resources.ResourceLocation>
    • format

      public String format(net.minecraft.resources.ResourceLocation value)
      Description copied from interface: ConfigType
      The value as a player would type it, the inverse of ConfigType.parse(java.lang.String). By default compact JSON.
      Specified by:
      format in interface ConfigType<net.minecraft.resources.ResourceLocation>
    • suggestions

      public List<String> suggestions()
      Description copied from interface: ConfigType
      Values to suggest in commands.
      Specified by:
      suggestions in interface ConfigType<net.minecraft.resources.ResourceLocation>