Package net.darkhax.bookshelf.api.util
Interface IPlatformHelper
- All Known Implementing Classes:
PlatformHelperFabric
public interface IPlatformHelper
The PlatformHelper provides useful context and information about the platform the game is running on.
-
Method Summary
Modifier and TypeMethodDescriptiondefault FileGets the specified configuration directory as a file reference.Gets the specified configuration path for the game.default FileGets the working directory of the game as a File.Gets the working directory path of the game directory.Gets a set of loaded mod IDs.getModName(String modId) Attempts to resolve the name of a mod using the associated mod ID.default net.minecraft.network.chat.MutableComponentgetModNameComponent(String modId) Attempts to resolve the name of a mod using the associated mod ID.default FileGets the primary directory that the current loader will load mods from.Gets the primary path that the current loader will load mods from.getModVersion(String modId) getName()Gets the name of the platform.Gets the physical environment that the code is running on.booleanChecks if the mod is running in a development environment.booleanisModLoaded(String modId) Checks if a given mod is loaded.default booleanChecks if the code is running on a physical client.booleanChecks 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
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
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
Gets the primary directory that the current loader will load mods from.- Returns:
- The currently specified mods directory.
-
getLoadedMods
Gets a set of loaded mod IDs.- Returns:
- A set of loaded mod IDs.
-
isModLoaded
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
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.
-
getModVersion
-
getModNameComponent
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.
-