Package net.mezzdev.config.gui.internal
Class ConfigValueEditorMetadata<T>
java.lang.Object
net.mezzdev.config.gui.internal.ConfigValueEditorMetadata<T>
- All Implemented Interfaces:
IConfigValueEditorMetadata<T>,IConfigValueLocalizationProvider<T>
- Direct Known Subclasses:
ListValueEditorMetadata
Standard editor metadata derived from a value's storage constraints.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigValueEditorMetadata(net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> serializer, ConfigValueEditorType<T> editorType) -
Method Summary
Modifier and TypeMethodDescriptionGet the available choices when the value has a finite set of valid options.Get the kind of editor used for this value.Optional<net.minecraft.network.chat.Component> getLocalizedValueDescription(String localizationKey, T value) Get the translated description component for a value option.net.minecraft.network.chat.ComponentgetLocalizedValueName(String localizationKey, T value) Get the translated name component for a value option.booleanCheck whether a proposed value can be applied.
-
Constructor Details
-
ConfigValueEditorMetadata
public ConfigValueEditorMetadata(net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> serializer, ConfigValueEditorType<T> editorType)
-
-
Method Details
-
getEditorType
Description copied from interface:IConfigValueEditorMetadataGet the kind of editor used for this value.- Specified by:
getEditorTypein interfaceIConfigValueEditorMetadata<T>
-
isValid
Description copied from interface:IConfigValueEditorMetadataCheck whether a proposed value can be applied.- Specified by:
isValidin interfaceIConfigValueEditorMetadata<T>
-
getAllValidValues
Description copied from interface:IConfigValueEditorMetadataGet the available choices when the value has a finite set of valid options.- Specified by:
getAllValidValuesin interfaceIConfigValueEditorMetadata<T>- Returns:
- the valid options, or empty when they cannot be enumerated
-
getLocalizedValueName
Description copied from interface:IConfigValueLocalizationProviderGet the translated name component for a value option.- Specified by:
getLocalizedValueNamein interfaceIConfigValueLocalizationProvider<T>- Parameters:
localizationKey- the translation key for the owning config value's namevalue- the value option
-
getLocalizedValueDescription
public Optional<net.minecraft.network.chat.Component> getLocalizedValueDescription(String localizationKey, T value) Description copied from interface:IConfigValueLocalizationProviderGet the translated description component for a value option.- Specified by:
getLocalizedValueDescriptionin interfaceIConfigValueLocalizationProvider<T>- Parameters:
localizationKey- the translation key for the owning config value's namevalue- the value option
-