Interface IPlatformHelper
- All Known Implementing Classes:
NeoForgePlatformHelper
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 every loaded modId.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.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.<T extends net.minecraft.world.inventory.AbstractContainerMenu>
voidunsafeRegisterMenu(net.minecraft.resources.ResourceLocation id, MenuRegister.ClientMenuFactory<T> clientFactory) Deprecated.
-
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.
-
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.
-
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.
-