Class ConfigEntry<T>

java.lang.Object
net.glasslauncher.mods.api.gcapi.impl.config.ConfigBase
net.glasslauncher.mods.api.gcapi.impl.config.ConfigEntry<T>
Direct Known Subclasses:
BaseListConfigEntry, BooleanConfigEntry, EnumConfigEntry, FloatConfigEntry, IntegerConfigEntry, StringConfigEntry

public abstract class ConfigEntry<T> extends ConfigBase
  • Field Details

    • value

      public T value
    • defaultValue

      public final T defaultValue
    • parent

      @Environment(CLIENT) protected net.minecraft.client.gui.screen.Screen parent
    • multiplayerLoaded

      public boolean multiplayerLoaded
    • maxLength

      protected MaxLength maxLength
    • drawableList

      protected List<HasDrawable> drawableList
  • Constructor Details

  • Method Details

    • init

      @Environment(CLIENT) public void init(net.minecraft.client.gui.screen.Screen parent, net.minecraft.client.font.TextRenderer textRenderer)
    • getDrawableValue

      public abstract T getDrawableValue()
    • setDrawableValue

      public abstract void setDrawableValue(T value)
    • isValueValid

      public abstract boolean isValueValid()
    • saveToField

      public void saveToField() throws IllegalAccessException
      Throws:
      IllegalAccessException
    • getMaxLength

      public MaxLength getMaxLength()
    • reset

      public abstract void reset(Object defaultValue) throws IllegalAccessException
      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.
      Throws:
      IllegalAccessException - Reflection can be used inside here without try/catch.
    • vanillaServerBehavior

      public void vanillaServerBehavior()
      This is called on all ConfigEntry objects when joining a vanilla server. Things done in here probably shouldn't be saved, so make sure you set multiplayerLoaded to true if you do anything.