Interface IPlatformHelper
- All Known Implementing Classes:
NeoForgePlatformHelper
public interface IPlatformHelper
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if compressed blocks are enabledbooleanCheck if crates are enableddefault StringGets the name of the environment type as a string.Gets the name of the current platformbooleanisBlockEnabled(String name) Check if a block is enabledbooleanCheck if the game is currently in a development environment.booleanisModLoaded(String modId) Checks if a mod with the given id is loaded.intGet the maximum compression level for blocksintGet the maximum compression level for cratesvoidregisterBlock(String name, net.minecraft.world.level.block.Block... blocks) Function for platform-dependent registration of BlocksvoidregisterCrate(String name, net.minecraft.world.level.block.Block... crateBlocks) Function for platform-dependent registration of Crates
-
Method Details
-
getPlatformName
String getPlatformName()Gets the name of the current platform- Returns:
- The name of the current platform.
-
isModLoaded
Checks if a mod with the given id is loaded.- Parameters:
modId- The mod to check if it is loaded.- Returns:
- True if the mod is loaded, false otherwise.
-
isDevelopmentEnvironment
boolean isDevelopmentEnvironment()Check if the game is currently in a development environment.- Returns:
- True if in a development environment, false otherwise.
-
getEnvironmentName
Gets the name of the environment type as a string.- Returns:
- The name of the environment type.
-
registerBlock
Function for platform-dependent registration of Blocks- Parameters:
name- the registry name of the Blockblocks- the Blocks to be registered
-
registerCrate
Function for platform-dependent registration of Crates- Parameters:
name- the registry name of the BlockcrateBlocks- the Crate Blocks to be registered
-
areBlocksEnabled
boolean areBlocksEnabled()Check if compressed blocks are enabled- Returns:
- True if compressed blocks are enabled, false otherwise.
-
areCratesEnabled
boolean areCratesEnabled()Check if crates are enabled- Returns:
- True if crates are enabled, false otherwise.
-
maxCompressionLevel
int maxCompressionLevel()Get the maximum compression level for blocks- Returns:
- The maximum compression level for blocks
-
maxCrateCompressionLevel
int maxCrateCompressionLevel()Get the maximum compression level for crates- Returns:
- The maximum compression level for crates
-
isBlockEnabled
Check if a block is enabled- Parameters:
name- The name of the block to check- Returns:
- True if the block is enabled, false otherwise
-