Interface IPlatformHelper
- All Known Implementing Classes:
NeoForgePlatformHelper
public interface IPlatformHelper
Service Provider Interface (SPI) abstracting environment and mod-loader specific operations.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the global configuration directory for the game instance.default StringgetModName(String modId) Retrieves the display name of a mod from its identifier.Returns the human-readable name of the running mod loader (e.g.booleanChecks if the game is running within a development environment.booleanisModLoaded(String modId) Checks if a mod with the given ID is present in the current environment.
-
Method Details
-
getPlatformName
String getPlatformName()Returns the human-readable name of the running mod loader (e.g. "Fabric" or "NeoForge").- Returns:
- The loader platform name string.
-
isModLoaded
Checks if a mod with the given ID is present in the current environment.- Parameters:
modId- The mod identifier to check.- Returns:
trueif the mod is loaded;falseotherwise.
-
isDevelopmentEnvironment
boolean isDevelopmentEnvironment()Checks if the game is running within a development environment.- Returns:
truein dev environments;falsein production builds.
-
getConfigDirectory
Path getConfigDirectory()Returns the global configuration directory for the game instance.- Returns:
- The
Pathto the config directory.
-
getModName
Retrieves the display name of a mod from its identifier.- Parameters:
modId- The mod ID.- Returns:
- The formatted mod display name.
-