Interface IConfigGuiRegistration
@NonExtendable
public interface IConfigGuiRegistration
Registration for config GUI customizations provided by one config GUI plugin.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureScreen(Consumer<IConfigScreenBuilder> screenBuilderConsumer) Customize the config screen for this mod.Get the factory for adapting text serializers to screen-value editor metadata.Get helpers for creating binding snapshots and implementing custom key mapping adapters.Get helper factories for config values backed by sortable runtime lists.<T extends net.minecraft.client.KeyMapping>
voidregisterKeyMappingAdapter(Class<T> mappingClass, Function<T, IKeyMappingAdapter> factory) Registers adapters for a key mapping class and its subclasses across config screens.voidregisterScreen(net.minecraft.network.chat.Component title, Supplier<? extends net.mezzdev.config.api.schema.IConfigSchema> schemaSupplier) Register a config screen.<T> voidregisterValueEditor(ConfigValueEditorType<T> editorType, IConfigValueEditorFactory<T> editorFactory) Register a custom value editor for config values that return the matching editor type.
-
Method Details
-
registerValueEditor
<T> void registerValueEditor(ConfigValueEditorType<T> editorType, IConfigValueEditorFactory<T> editorFactory) Register a custom value editor for config values that return the matching editor type.- Type Parameters:
T- the config value type edited by this control- Parameters:
editorType- the config value editor type to handleeditorFactory- creates custom value editors- Since:
- 0.1.0
-
getEditorMetadataFactory
IConfigValueEditorMetadataFactory getEditorMetadataFactory()Get the factory for adapting text serializers to screen-value editor metadata.- Since:
- 0.6.0
-
registerKeyMappingAdapter
<T extends net.minecraft.client.KeyMapping> void registerKeyMappingAdapter(Class<T> mappingClass, Function<T, IKeyMappingAdapter> factory) Registers adapters for a key mapping class and its subclasses across config screens. The most specific registered class wins.- Type Parameters:
T- the key mapping type- Parameters:
mappingClass- the key mapping class to adaptfactory- creates an adapter for each supplied mapping- Throws:
IllegalArgumentException- if this class already has an adapter factory- Since:
- 0.6.0
-
getKeyMappingHelper
IKeyMappingHelper getKeyMappingHelper()Get helpers for creating binding snapshots and implementing custom key mapping adapters.- Returns:
- shared key mapping helpers
- Since:
- 0.6.0
-
getSortableConfigValueFactory
ISortableConfigValueFactory getSortableConfigValueFactory()Get helper factories for config values backed by sortable runtime lists.Prefer adding sorting configs directly with
IConfigScreenCategoryBuilder.addSortingConfig(String, String, net.mezzdev.config.api.sorting.ISortingConfig, java.util.Collection, net.mezzdev.config.api.value.serializer.IConfigValueSerializer)orIConfigScreenCategoryBuilder.addStringSortingConfig(String, String, net.mezzdev.config.api.sorting.ISortingConfig, java.util.Collection)when customizing a screen category. This helper remains for callers that still need to create a screen value explicitly.- Returns:
- helper factories for sortable runtime list values
- Since:
- 0.1.0
-
configureScreen
Customize the config screen for this mod.This can be used with a screen registered through
registerScreen(Component, Supplier)or with a screen automatically detected by the config GUI from a platform-native config system. This method does not create a screen on its own.- Parameters:
screenBuilderConsumer- receives the screen builder- Since:
- 0.1.0
-
registerScreen
void registerScreen(net.minecraft.network.chat.Component title, Supplier<? extends net.mezzdev.config.api.schema.IConfigSchema> schemaSupplier) Register a config screen.- Parameters:
title- the title shown at the top of the config screenschemaSupplier- supplies the config schema each time the screen is opened- Since:
- 0.1.0
-