Interface IPlatformHelper

All Known Implementing Classes:
FabricPlatformHelper

public interface IPlatformHelper
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    void
    addCompostable(Supplier<? extends net.minecraft.world.level.ItemLike> item, float chance)
    Adds an item to the composter.
    void
    addFurnaceFuel(Supplier<? extends net.minecraft.world.level.ItemLike> item, int burnTime)
    Adds an item as furnace fuel.
    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.
    void
    Registers an addition resource/data pack
    default String
    Gets the name of the environment type as a string.
    Gets the name of the current platform
    getResourcePath(String modId, String resource)
     
    boolean
    Check if the game is currently in a development environment.
    boolean
    Checks if a mod with the given id is loaded early.
    boolean
    Checks if a mod with the given id is loaded.
    <I, T extends I>
    Supplier<T>
    register(net.minecraft.core.Registry<I> registry, String modId, String name, Supplier<T> sup)
    Registers an object
    void
    registerConfig(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

      boolean isModLoaded(String modId)
      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

      boolean isModEarlyLoaded(String modId)
      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

      Path getResourcePath(String modId, String resource)
    • isDevelopmentEnvironment

      boolean isDevelopmentEnvironment()
      Check if the game is currently in a development environment.
      Returns:
      True if in a development environment, false otherwise.
    • getEnvironmentName

      default String 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. Use addMix otherwise.
      Parameters:
      input -
      ingredient -
      output -
    • addCompostable

      void addCompostable(Supplier<? extends net.minecraft.world.level.ItemLike> item, float chance)
      Adds an item to the composter.
      Parameters:
      item - to be composted.
      chance - to produce a layer in the composter.
    • addFurnaceFuel

      void addFurnaceFuel(Supplier<? extends net.minecraft.world.level.ItemLike> item, int burnTime)
      Adds an item as furnace fuel. Use only when getBurnTime somehow isn't available to override.
      Parameters:
      item - to be used as fuel
      burnTime - 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 to
      modId -
    • addPack

      void addPack(Registration.PackData pack, String modId)
      Registers an addition resource/data pack
      Parameters:
      pack -
      modId -