Class WidgetBuilderImpl<SELF extends WidgetBuilder<SELF,T>,T>

java.lang.Object
net.replaceitem.reconfigure.config.widget.builder.WidgetBuilderImpl<SELF,T>
All Implemented Interfaces:
WidgetBuilder<SELF,T>
Direct Known Subclasses:
AbstractTextFieldWidgetBuilderImpl, CheckboxWidgetBuilderImpl, ChipListWidgetBuilderImpl, ColorPickerWidgetBuilderImpl, CustomWidgetBuilderImpl, CyclingButtonWidgetBuilderImpl, SliderWidgetBuilderImpl

public abstract class WidgetBuilderImpl<SELF extends WidgetBuilder<SELF,T>,T> extends Object implements WidgetBuilder<SELF,T>
  • Field Details

    • propertyBuilder

      protected final PropertyBuilderImpl<?,T> propertyBuilder
    • displayName

      @Nullable protected @Nullable net.minecraft.text.Text displayName
    • tooltip

      @Nullable protected @Nullable net.minecraft.text.Text tooltip
  • Constructor Details

  • Method Details

    • displayName

      public SELF displayName(net.minecraft.text.Text displayName)
      Description copied from interface: WidgetBuilder
      Sets the display name of the widget as rendered in the config screen. When not set, defaults to a translatable text with key reconfigure.property.[namespace].[propertyname].
      Specified by:
      displayName in interface WidgetBuilder<SELF extends WidgetBuilder<SELF,T>,T>
      Parameters:
      displayName - The display name text
      Returns:
      The builder for chaining
    • tooltip

      public SELF tooltip(net.minecraft.text.Text tooltip)
      Description copied from interface: WidgetBuilder
      Sets the tooltip text for the widget. This is shown when hovering over the property display name in the config widget.
      Specified by:
      tooltip in interface WidgetBuilder<SELF extends WidgetBuilder<SELF,T>,T>
      Parameters:
      tooltip - The tooltip text
      Returns:
      The builder for chaining
    • tooltip

      public SELF tooltip()
      Description copied from interface: WidgetBuilder
      Enabled the tooltip for the widget. The text of the tooltip will default to a translatable text with key reconfigure.property.[namespace].[propertyname].tooltip.
      Specified by:
      tooltip in interface WidgetBuilder<SELF extends WidgetBuilder<SELF,T>,T>
      Returns:
      The builder for chaining
    • preBuild

      protected void preBuild(PropertyHolder<T> property)
      This is run before calling buildImpl(PropertyHolder). Can be used to fill in missing default values.
    • postBuild

      protected void postBuild(PropertyHolder<T> property)
      This is run after buildImpl(PropertyHolder) to add the created Property to the tab.
    • build

      public final PropertyImpl<T> build()
      Description copied from interface: WidgetBuilder
      Builds the widget and the property. The built widget and property is automatically added to the config tab on which this builder was created.
      Specified by:
      build in interface WidgetBuilder<SELF extends WidgetBuilder<SELF,T>,T>
      Returns:
      The built property
    • buildImpl

      protected PropertyHolder<T> buildImpl(PropertyHolder<T> property)
    • buildWidgetFactory

      protected abstract ConfigWidgetFactory<T> buildWidgetFactory(BaseSettings baseSettings)
    • self

      protected SELF self()