Class BaseListConfigEntry<T>

All Implemented Interfaces:
ConfigEntryWithButton
Direct Known Subclasses:
FloatListConfigEntry, IntegerListConfigEntry, StringListConfigEntry

public abstract class BaseListConfigEntry<T> extends ConfigEntry<T[]> implements ConfigEntryWithButton
  • Constructor Details

    • BaseListConfigEntry

      public BaseListConfigEntry(String id, String name, String description, Field parentField, Object parentObject, boolean multiplayerSynced, T[] value, T[] defaultValue, MaxLength maxLength)
  • Method Details

    • init

      public void init(net.minecraft.client.gui.screen.Screen parent, net.minecraft.client.font.TextRenderer textRenderer)
      Overrides:
      init in class ConfigEntry<T[]>
    • createListScreen

      @Environment(CLIENT) public abstract BaseListScreenBuilder<T> createListScreen()
    • strToVal

      public abstract T strToVal(String str)
    • getDrawableValue

      public T[] getDrawableValue()
      Specified by:
      getDrawableValue in class ConfigEntry<T[]>
    • setDrawableValue

      public void setDrawableValue(T[] value)
      Specified by:
      setDrawableValue in class ConfigEntry<T[]>
    • getDrawables

      @NotNull public @NotNull List<HasDrawable> getDrawables()
      Specified by:
      getDrawables in class ConfigBase
    • onClick

      @Environment(CLIENT) public void onClick()
      Description copied from interface: ConfigEntryWithButton
      Fired when someone clicks a button for your config category.
      Specified by:
      onClick in interface ConfigEntryWithButton
    • reset

      public void reset(Object defaultValue) throws IllegalAccessException
      Description copied from class: ConfigEntry
      Called when resetting the entry to the default value. Yes, I'm making you write this part yourself, I don't know how your custom objects work and how to properly deep clone them.
      Specified by:
      reset in class ConfigEntry<T[]>
      Throws:
      IllegalAccessException - Reflection can be used inside here without try/catch.