Package com.ldtteam.structurize.config
Class Configuration
java.lang.Object
com.ldtteam.structurize.config.Configuration
Mod root configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionConfiguration(net.minecraftforge.fml.ModContainer modContainer) Builds configuration tree. -
Method Summary
Modifier and TypeMethodDescriptionOptional<net.minecraftforge.common.ForgeConfigSpec.ValueSpec>getSpecFromValue(net.minecraftforge.common.ForgeConfigSpec.ConfigValue<?> value) voidonConfigLoad(net.minecraftforge.fml.config.ModConfig modConfig) cache starting values for watchersvoidonConfigReload(net.minecraftforge.fml.config.ModConfig modConfig) iterate watchers and fire changes if neededvoidonConfigValueEdit(net.minecraftforge.common.ForgeConfigSpec.ConfigValue<?> configValue) This should be called from any code that manually changes ConfigValues using set functions.<T> voidset(net.minecraftforge.common.ForgeConfigSpec.ConfigValue<T> configValue, T value) Setter wrapper so watchers are fine.
-
Constructor Details
-
Configuration
public Configuration(net.minecraftforge.fml.ModContainer modContainer) Builds configuration tree.- Parameters:
modContainer- from event
-
-
Method Details
-
getClient
-
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
-