Class DefaultWidgetRegistry

java.lang.Object
johnsmith.configoverhauled.impl.client.gui.registry.DefaultWidgetRegistry
All Implemented Interfaces:
WidgetRegistry

public class DefaultWidgetRegistry extends Object implements WidgetRegistry
  • Constructor Details

    • DefaultWidgetRegistry

      public DefaultWidgetRegistry()
  • Method Details

    • register

      public <P extends Property<?>> void register(Class<P> propertyClass, WidgetFactory<? super P> factory)
      Description copied from interface: WidgetRegistry
      Binds a factory to generate widgets for a specific property type.
      Specified by:
      register in interface WidgetRegistry
      Type Parameters:
      P - The property type.
      Parameters:
      propertyClass - The class of the property.
      factory - The factory responsible for creating the widget for this property type.
    • createEntry

      public <T> ConfigEntry createEntry(Property<T> property, ConfigScreen screen, net.minecraft.client.Minecraft mc, Runnable callback)
      Description copied from interface: WidgetRegistry
      Looks up the registered factory for the given property's type and constructs a new UI entry.
      Specified by:
      createEntry in interface WidgetRegistry
      Type Parameters:
      T - The underlying data type of the property.
      Parameters:
      property - The configuration property to create a widget for.
      screen - The configuration screen hosting the widget.
      mc - The active Minecraft client instance.
      callback - A callback triggered when the widget updates the property's value.
      Returns:
      A newly constructed ConfigEntry.