Interface IPlatformHelper
- All Known Implementing Classes:
FabricPlatformHelper
public interface IPlatformHelper
Common platform helper service interface.
-
Method Summary
Modifier and TypeMethodDescriptionintgetBurnTime(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.crafting.RecipeType<?> recipeType) Gets the burn time of an ItemStack.net.minecraft.world.level.LevelGets the current level.default StringGets the name of the environment type as a string.Gets the translation key for milk.Gets the name of the current platformnet.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> Gets the TOOLS_AND_UTILITIES creative tab.booleanCheck if the game is currently in a development environment.booleanisModLoaded(String modId) Checks if a mod with the given id is loaded.
-
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.
-
getCurrentLevel
net.minecraft.world.level.Level getCurrentLevel()Gets the current level.- Returns:
- the current level.
-
getToolsAndUtilitiesTab
net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> getToolsAndUtilitiesTab()Gets the TOOLS_AND_UTILITIES creative tab.- Returns:
- TOOLS_AND_UTILITIES creative tab.
-
getMilkTranslationKey
String getMilkTranslationKey()Gets the translation key for milk.- Returns:
- translation key for milk
-
getBurnTime
int getBurnTime(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.crafting.RecipeType<?> recipeType) Gets the burn time of an ItemStack.- Returns:
- burn time of an ItemStack
-