Class ConfigurablePropertyData<T>

java.lang.Object
org.cyclops.cyclopscore.config.ConfigurablePropertyData<T>
Type Parameters:
T - The property value.

public final class ConfigurablePropertyData<T> extends Object
A holder class for properties that go inside the config file. Used inside the ConfigHandler for configuring the settings of the configurable. Do no confuse with ConfigurableProperty which is an annotation an is internally used to make new instances of ConfigurablePropertyData.
  • Constructor Details

    • ConfigurablePropertyData

      public ConfigurablePropertyData(ModBase mod, String category, String name, T defaultValue, String comment, boolean isCommandable, net.neoforged.fml.config.ModConfig.Type configLocation, Field field, boolean requiresWorldRestart, boolean requiresMcRestart, boolean showInGui, int minValue, int maxValue)
      Define a new configurable property.
      Parameters:
      mod - The owner mod.
      category - Category.
      name - Name of the property.
      defaultValue - Value of the property.
      comment - Comment of the property for in the config file.
      isCommandable - If this property should be able to be changed at runtime via commands.
      configLocation - The config location.
      field - The field of the ExtendedConfig this property refers to.
      requiresWorldRestart - If this property requires a world restart after change.
      requiresMcRestart - If this property requires a minecraft restart after change.
      showInGui - If this property should be editable via the gui.
      minValue - The minimal int value.
      maxValue - The maximal int value.
  • Method Details

    • onConfigInit

      public void onConfigInit(net.neoforged.neoforge.common.ModConfigSpec.Builder configBuilder)
    • getConfigProperty

      public net.neoforged.neoforge.common.ModConfigSpec.ConfigValue<T> getConfigProperty()
    • isCommandable

      public boolean isCommandable()
      Returns:
      Can this property be changed through commands.
    • getCategory

      public String getCategory()
    • getName

      public String getName()
    • getConfigLocation

      public net.neoforged.fml.config.ModConfig.Type getConfigLocation()
    • getLanguageKey

      public String getLanguageKey()
      Returns:
      the LanguageKey
    • saveToField

      public void saveToField()