Interface IPlatformHelper
- All Known Implementing Classes:
FabricPlatformHelper
public interface IPlatformHelper
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBrewingRecipe(Supplier<? extends net.minecraft.world.item.crafting.Ingredient> input, Supplier<? extends net.minecraft.world.item.crafting.Ingredient> ingredient, Supplier<? extends net.minecraft.world.item.ItemStack> output) Adds a brewing recipe.voidaddCompostable(Supplier<? extends net.minecraft.world.level.ItemLike> item, float chance) Adds an item to the composter.voidaddFurnaceFuel(Supplier<? extends net.minecraft.world.level.ItemLike> item, int burnTime) Adds an item as furnace fuel.voidaddMix(Supplier<? extends net.minecraft.world.item.alchemy.Potion> input, Supplier<? extends net.minecraft.world.item.Item> ingredient, Supplier<? extends net.minecraft.world.item.alchemy.Potion> output) Adds a brewing mix.voidaddPack(Registration.PackData pack, String modId) Registers an addition resource/data packdefault StringGets the name of the environment type as a string.Gets the name of the current platformgetResourcePath(String modId, String resource) booleanCheck if the game is currently in a development environment.booleanisModEarlyLoaded(String modId) Checks if a mod with the given id is loaded early.booleanisModLoaded(String modId) Checks if a mod with the given id is loaded.<I,T extends I>
Supplier<T>Registers an objectvoidregisterConfig(net.minecraftforge.common.ForgeConfigSpec spec, net.minecraftforge.fml.config.ModConfig.Type type, String modId) Registers a config
-
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.
-
isModEarlyLoaded
Checks if a mod with the given id is loaded early.- Parameters:
modId- The mod to check if it is loaded.- Returns:
- True if the mod is loaded, false otherwise.
-
getResourcePath
-
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.
-
register
<I,T extends I> Supplier<T> register(net.minecraft.core.Registry<I> registry, String modId, String name, Supplier<T> sup) Registers an object- Type Parameters:
I-T-- Parameters:
registry-modId-name-sup-- Returns:
-
addMix
void addMix(Supplier<? extends net.minecraft.world.item.alchemy.Potion> input, Supplier<? extends net.minecraft.world.item.Item> ingredient, Supplier<? extends net.minecraft.world.item.alchemy.Potion> output) Adds a brewing mix.- Parameters:
input-ingredient-output-
-
addBrewingRecipe
void addBrewingRecipe(Supplier<? extends net.minecraft.world.item.crafting.Ingredient> input, Supplier<? extends net.minecraft.world.item.crafting.Ingredient> ingredient, Supplier<? extends net.minecraft.world.item.ItemStack> output) Adds a brewing recipe. For brewing that has a non-potion as input or output. UseaddMixotherwise.- Parameters:
input-ingredient-output-
-
addCompostable
Adds an item to the composter.- Parameters:
item- to be composted.chance- to produce a layer in the composter.
-
addFurnaceFuel
Adds an item as furnace fuel. Use only when getBurnTime somehow isn't available to override.- Parameters:
item- to be used as fuelburnTime- ticks to burn. A standard furnace recipe takes 200 ticks.
-
registerConfig
void registerConfig(net.minecraftforge.common.ForgeConfigSpec spec, net.minecraftforge.fml.config.ModConfig.Type type, String modId) Registers a config- Parameters:
spec-type- Side that the config applies tomodId-
-
addPack
Registers an addition resource/data pack- Parameters:
pack-modId-
-