commoble.databuddy.config

## Class ConfigHelper

- java.lang.Object
- - commoble.databuddy.config.ConfigHelper

    public class ConfigHelper
    extends java.lang.Object

Config helper for automatically subscribing forge configs to config reload events as you build them. See DataBuddyExampleMod and ExampleServerConfig in the examplemod for usage examples.

Example mod on github

Example config class on github

### Nested Class Summary

Nested Classes
`static class` `ConfigHelper.ConfigValueListener<T>` A config-reload-sensitive wrapper around your config value
`static class` `ConfigHelper.Subscriber` Subscriber instances are given to your config class's constructor

### Constructor Summary

Constructors
Constructor and Description
`ConfigHelper()`

### Method Summary

All Methods Static Methods Concrete Methods

`static <T> T`

`register(net.minecraftforge.fml.ModLoadingContext modContext, net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext fmlContext, net.minecraftforge.common.ForgeConfigSpec.Builder builder, net.minecraftforge.fml.config.ModConfig.Type configType, java.util.function.BiFunction<net.minecraftforge.common.ForgeConfigSpec.Builder,ConfigHelper.Subscriber,T> configBuilder)`
Call this in your @Mod class constructor.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ConfigHelper

    public ConfigHelper()

### Method Detail

#### register

    public static <T> T register(net.minecraftforge.fml.ModLoadingContext modContext,
                                 net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext fmlContext,
                                 net.minecraftforge.common.ForgeConfigSpec.Builder builder,
                                 net.minecraftforge.fml.config.ModConfig.Type configType,
                                 java.util.function.BiFunction<net.minecraftforge.common.ForgeConfigSpec.Builder,ConfigHelper.Subscriber,T> configBuilder)

Call this in your @Mod class constructor.

Type Parameters:
  `T` - Your config class
Parameters:
  `modContext` - mod context from ModLoadingContext.get()
  `fmlContext` - mod context from FMLJavaModLoadingContext.get()
  `builder` - config builder from "new ForgeConfigSpec.Builder()" -- needed to be invoked outside of ConfigHelper due to classloading weirdness
  `configType` - Forge config type:
  - SERVER configs are defined by the server and synced to clients
  - COMMON configs are definable by both server and clients and not synced (they may have different values)
  - CLIENT configs are defined by clients and not used on the server
  `configBuilder` - Typically the constructor for your config class
Returns:
  An instance of your config class