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 Type
    Method
    Description
    Returns the global configuration directory for the game instance.
    default String
    Retrieves the display name of a mod from its identifier.
    Returns the human-readable name of the running mod loader (e.g.
    boolean
    Checks if the game is running within a development environment.
    boolean
    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

      boolean isModLoaded(String modId)
      Checks if a mod with the given ID is present in the current environment.
      Parameters:
      modId - The mod identifier to check.
      Returns:
      true if the mod is loaded; false otherwise.
    • isDevelopmentEnvironment

      boolean isDevelopmentEnvironment()
      Checks if the game is running within a development environment.
      Returns:
      true in dev environments; false in production builds.
    • getConfigDirectory

      Path getConfigDirectory()
      Returns the global configuration directory for the game instance.
      Returns:
      The Path to the config directory.
    • getModName

      default String getModName(String modId)
      Retrieves the display name of a mod from its identifier.
      Parameters:
      modId - The mod ID.
      Returns:
      The formatted mod display name.