Class NeoForgePlatformHelper
java.lang.Object
se.itssimple.obsidianweave.neoforge.platform.NeoForgePlatformHelper
- All Implemented Interfaces:
IPlatformConfigHelper
NeoForge-specific implementation of platform config helper for Obsidian Weave.
Handles registration and management of mod configuration using NeoForge's config system.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TgetValue(ConfigEntry<T> entry) Gets the value of a config entry, using the platform binding if available.voidload(ConfigHolder holder) Loads the configuration values for the given holder from Forge.static voidonModConfigEvent(net.neoforged.fml.event.config.ModConfigEvent event) Handles mod config events, syncing values for the affected mod.voidregister(ConfigHolder holder) Registers a config holder and builds its Forge config spec.voidsave(ConfigHolder holder) Saves the configuration for the given holder.<T> voidsetValue(ConfigEntry<T> entry, T value) Sets the value of a config entry, updating the platform binding if necessary.
-
Constructor Details
-
NeoForgePlatformHelper
public NeoForgePlatformHelper()
-
-
Method Details
-
register
Registers a config holder and builds its Forge config spec.- Specified by:
registerin interfaceIPlatformConfigHelper- Parameters:
holder- The config holder to register.
-
load
Loads the configuration values for the given holder from Forge.- Specified by:
loadin interfaceIPlatformConfigHelper- Parameters:
holder- The config holder to load values for.
-
save
Saves the configuration for the given holder.- Specified by:
savein interfaceIPlatformConfigHelper- Parameters:
holder- The config holder to save.
-
getValue
Gets the value of a config entry, using the platform binding if available.- Specified by:
getValuein interfaceIPlatformConfigHelper- 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
Sets the value of a config entry, updating the platform binding if necessary.- Specified by:
setValuein interfaceIPlatformConfigHelper- 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.
-