Interface IPlatformHelper

All Known Implementing Classes:
ForgePlatformHelper

public interface IPlatformHelper
The PlatformHelper provides useful context and information about the platform the game is running on.
  • 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.
    • getLoadedMods

      Set<ModEntry> getLoadedMods()
      Gets a set of every loaded modId.
      Returns:
    • 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.
    • unsafeRegisterMenu

      @Deprecated <T extends net.minecraft.world.inventory.AbstractContainerMenu> void unsafeRegisterMenu(net.minecraft.resources.ResourceLocation id, MenuRegister.ClientMenuFactory<T> clientFactory)
      Deprecated.