Interface IPlatformHelper

All Known Implementing Classes:
PlatformHelperNeoForge

public interface IPlatformHelper
The PlatformHelper provides useful context and information about the platform the game is running on.
  • Method Summary

    Modifier and Type
    Method
    Description
    default File
    Gets the specified configuration directory as a file reference.
    Gets the specified configuration path for the game.
    default File
    Gets the working directory of the game as a File.
    Gets the working directory path of the game directory.
    Attempts to resolve the name of a mod using the associated mod ID.
    default net.minecraft.network.chat.MutableComponent
    Attempts to resolve the name of a mod using the associated mod ID.
    default File
    Gets the primary directory that the current loader will load mods from.
    Gets the primary path that the current loader will load mods from.
    Gets the name of the platform.
    Gets the physical environment that the code is running on.
    boolean
    Checks if the mod is running in a development environment.
    boolean
    Checks if a given mod is loaded.
    default boolean
    Checks if the code is running on a physical client.
    boolean
    Checks if the mod is currently running in an environment with game tests enabled.
  • Method Details

    • getGamePath

      Path getGamePath()
      Gets the working directory path of the game directory.
      Returns:
      The working directory path of the game directory.
    • getGameDirectory

      default File getGameDirectory()
      Gets the working directory of the game as a File.
      Returns:
      The working directory of the game.
    • getConfigPath

      Path getConfigPath()
      Gets the specified configuration path for the game.
      Returns:
      The specified configuration path for the game.
    • getConfigDirectory

      default File getConfigDirectory()
      Gets the specified configuration directory as a file reference.
      Returns:
      The specified configuration path for the game.
    • getModsPath

      Path getModsPath()
      Gets the primary path that the current loader will load mods from.
      Returns:
      The currently specified mods path.
    • getModsDirectory

      default File getModsDirectory()
      Gets the primary directory that the current loader will load mods from.
      Returns:
      The currently specified mods directory.
    • isModLoaded

      boolean isModLoaded(String modId)
      Checks if a given mod is loaded.
      Parameters:
      modId - The mod id to search for.
      Returns:
      True when the specified mod id has been loaded.
    • isDevelopmentEnvironment

      boolean isDevelopmentEnvironment()
      Checks if the mod is running in a development environment.
      Returns:
      True when the mod is running in a developer environment.
    • getPhysicalSide

      PhysicalSide getPhysicalSide()
      Gets the physical environment that the code is running on.
      Returns:
      The physical environment that the code is running on.
    • isPhysicalClient

      default boolean isPhysicalClient()
      Checks if the code is running on a physical client.
      Returns:
      Returns true when the code is running on a physical client.
    • getModName

      @Nullable String getModName(String modId)
      Attempts to resolve the name of a mod using the associated mod ID. If no mod is not available the provided ID will be treated as the name.
      Parameters:
      modId - The ID of the mod to lookup.
      Returns:
      The name of the mod associated with the given mod ID. If no mod is not available the provided ID will be treated as the name.
    • getModNameComponent

      @Nullable default net.minecraft.network.chat.MutableComponent getModNameComponent(String modId)
      Attempts to resolve the name of a mod using the associated mod ID. If no mod is not available the provided ID will be treated as the name.
      Parameters:
      modId - The ID of the mod to lookup.
      Returns:
      The name of the mod associated with the given mod ID. If no mod is not available the provided ID will be treated as the name.
    • isTestingEnvironment

      boolean isTestingEnvironment()
      Checks if the mod is currently running in an environment with game tests enabled.
      Returns:
      Are game tests currently enabled?
    • getName

      String getName()
      Gets the name of the platform.
      Returns:
      The name of the platform.