Class NeoForgePlatformHelper

java.lang.Object
se.itssimple.obsidianweave.neoforge.platform.NeoForgePlatformHelper
All Implemented Interfaces:
IPlatformConfigHelper

public class NeoForgePlatformHelper extends Object implements IPlatformConfigHelper
NeoForge-specific implementation of platform config helper for Obsidian Weave. Handles registration and management of mod configuration using NeoForge's config system.
  • Constructor Details

    • NeoForgePlatformHelper

      public NeoForgePlatformHelper()
  • Method Details

    • register

      public void register(ConfigHolder holder)
      Registers a config holder and builds its Forge config spec.
      Specified by:
      register in interface IPlatformConfigHelper
      Parameters:
      holder - The config holder to register.
    • load

      public void load(ConfigHolder holder)
      Loads the configuration values for the given holder from Forge.
      Specified by:
      load in interface IPlatformConfigHelper
      Parameters:
      holder - The config holder to load values for.
    • save

      public void save(ConfigHolder holder)
      Saves the configuration for the given holder.
      Specified by:
      save in interface IPlatformConfigHelper
      Parameters:
      holder - The config holder to save.
    • getValue

      public <T> T getValue(ConfigEntry<T> entry)
      Gets the value of a config entry, using the platform binding if available.
      Specified by:
      getValue in interface IPlatformConfigHelper
      Type Parameters:
      T - The type of the config entry value.
      Parameters:
      entry - The config entry to get the value from.
      Returns:
      The value of the config entry.
    • setValue

      public <T> void setValue(ConfigEntry<T> entry, T value)
      Sets the value of a config entry, updating the platform binding if necessary.
      Specified by:
      setValue in interface IPlatformConfigHelper
      Type Parameters:
      T - The type of the config entry value.
      Parameters:
      entry - The config entry to set the value for.
      value - The value to set.
    • onModConfigEvent

      public static void onModConfigEvent(net.neoforged.fml.event.config.ModConfigEvent event)
      Handles mod config events, syncing values for the affected mod.
      Parameters:
      event - The config event to handle.