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 Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<net.minecraft.resources.ResourceLocation>codec()format(net.minecraft.resources.ResourceLocation value) The value as a player would type it, the inverse ofConfigType.parse(java.lang.String).ValidationResult<net.minecraft.resources.ResourceLocation>Reads a value typed by a player, and validates it.@Nullable net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>registry()The registry whose entries are suggested, if any.Values to suggest in commands.ValidationResult<net.minecraft.resources.ResourceLocation>validate(net.minecraft.resources.ResourceLocation value) Checks a value, possibly correcting it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ixdarklord.coolcatcore.api.config.type.ConfigType
describe, equals
-
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:
codecin interfaceConfigType<net.minecraft.resources.ResourceLocation>
-
validate
public ValidationResult<net.minecraft.resources.ResourceLocation> validate(net.minecraft.resources.ResourceLocation value) Description copied from interface:ConfigTypeChecks a value, possibly correcting it.- Specified by:
validatein interfaceConfigType<net.minecraft.resources.ResourceLocation>
-
parse
Description copied from interface:ConfigTypeReads a value typed by a player, and validates it. By default the text is JSON for the codec.- Specified by:
parsein interfaceConfigType<net.minecraft.resources.ResourceLocation>
-
format
Description copied from interface:ConfigTypeThe value as a player would type it, the inverse ofConfigType.parse(java.lang.String). By default compact JSON.- Specified by:
formatin interfaceConfigType<net.minecraft.resources.ResourceLocation>
-
suggestions
Description copied from interface:ConfigTypeValues to suggest in commands.- Specified by:
suggestionsin interfaceConfigType<net.minecraft.resources.ResourceLocation>
-