Class ConfigEditSession

java.lang.Object
net.ixdarklord.coolcatcore.internal.config.client.gui.ConfigEditSession

public final class ConfigEditSession extends Object
  • Constructor Details

    • ConfigEditSession

      public ConfigEditSession(ConfigImpl config)
  • Method Details

    • config

      public ConfigImpl config()
    • access

      public ClientConfigManager.Access access()
    • get

      public Object get(ConfigValueImpl<?> value)
    • isModified

      public boolean isModified(ConfigValueImpl<?> value)
    • isDefault

      public boolean isDefault(ConfigValueImpl<?> value)
    • error

      public Optional<net.minecraft.network.chat.Component> error(ConfigValueImpl<?> value)
    • modifiedCount

      public int modifiedCount()
    • hasErrors

      public boolean hasErrors()
    • errors

      public Collection<net.minecraft.network.chat.Component> errors()
    • isEditable

      public boolean isEditable(ConfigValueImpl<?> value)
      Whether the player may change the value: the config is editable here, and a server-only value is visible.
    • isActive

      public boolean isActive(ConfigValueImpl<?> value)
      Whether the value's dependency is met by the pending values.
    • isVisible

      public boolean isVisible(ConfigValueImpl<?> value)
      Whether a remote player sees this value at all: server-only values aren't sent to them.
    • set

      public void set(ConfigValueImpl<?> value, Object newValue)
      Sets a pending value, checked by the value's validators; invalid values are reported instead.
    • setError

      public void setError(ConfigValueImpl<?> value, net.minecraft.network.chat.Component error)
    • setAll

      public void setAll(Map<ConfigValueImpl<?>, Object> values)
      Sets several pending values as one undoable step.
    • resetToDefaults

      public void resetToDefaults(Collection<ConfigValueImpl<?>> values)
    • discard

      public void discard(Collection<ConfigValueImpl<?>> values)
      Drops pending changes, as if nothing had been edited.
    • applyPreset

      public void applyPreset(ConfigPreset preset)
    • canUndo

      public boolean canUndo()
    • canRedo

      public boolean canRedo()
    • undo

      public void undo()
    • redo

      public void redo()
    • onConfigChanged

      public void onConfigChanged()
      Drops pending values that the config now holds anyway (after the server's values arrived).
    • save

      public RestartRequirement save()
      Applies the pending values: locally (and saves the file), or by sending them to the server.
      Returns:
      the strictest restart the changes need
    • saveAndNotify

      public void saveAndNotify()
      Saves as save() does, and tells the player: a toast for a local save, and what must restart.
    • slot

      public <T> EditSlot<T> slot(ConfigValueImpl<T> value)
      A slot for one of this config's values.