Class Configuration

java.lang.Object
com.ldtteam.structurize.config.Configuration

public class Configuration extends Object
Mod root configuration.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Configuration(net.minecraftforge.fml.ModContainer modContainer)
    Builds configuration tree.
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    Optional<net.minecraftforge.common.ForgeConfigSpec.ValueSpec>
    getSpecFromValue(net.minecraftforge.common.ForgeConfigSpec.ConfigValue<?> value)
     
    void
    onConfigLoad(net.minecraftforge.fml.config.ModConfig modConfig)
    cache starting values for watchers
    void
    onConfigReload(net.minecraftforge.fml.config.ModConfig modConfig)
    iterate watchers and fire changes if needed
    void
    onConfigValueEdit(net.minecraftforge.common.ForgeConfigSpec.ConfigValue<?> configValue)
    This should be called from any code that manually changes ConfigValues using set functions.
    <T> void
    set(net.minecraftforge.common.ForgeConfigSpec.ConfigValue<T> configValue, T value)
    Setter wrapper so watchers are fine.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Configuration

      public Configuration(net.minecraftforge.fml.ModContainer modContainer)
      Builds configuration tree.
      Parameters:
      modContainer - from event
  • Method Details

    • getClient

      public ClientConfiguration getClient()
    • getServer

      public ServerConfiguration getServer()
    • onConfigLoad

      public void onConfigLoad(net.minecraftforge.fml.config.ModConfig modConfig)
      cache starting values for watchers
    • onConfigReload

      public void onConfigReload(net.minecraftforge.fml.config.ModConfig modConfig)
      iterate watchers and fire changes if needed
    • set

      public <T> void set(net.minecraftforge.common.ForgeConfigSpec.ConfigValue<T> configValue, T value)
      Setter wrapper so watchers are fine. This should be called from any code that manually changes ConfigValues using set functions. (Mostly done by settings UIs)
    • onConfigValueEdit

      public void onConfigValueEdit(net.minecraftforge.common.ForgeConfigSpec.ConfigValue<?> configValue)
      This should be called from any code that manually changes ConfigValues using set functions. (Mostly done by settings UIs)
      Parameters:
      configValue - which config value was changed
    • getSpecFromValue

      public Optional<net.minecraftforge.common.ForgeConfigSpec.ValueSpec> getSpecFromValue(net.minecraftforge.common.ForgeConfigSpec.ConfigValue<?> value)
      Parameters:
      value - config value from this mod
      Returns:
      value spec, crashes in dev if not found