Class ForgePlatformHelper

java.lang.Object
com.github.voidleech.oblivion.services.ForgePlatformHelper
All Implemented Interfaces:
IPlatformHelper

public class ForgePlatformHelper extends Object implements IPlatformHelper
  • Field Details

    • REGISTRIES

      public static Map<String,Map<net.minecraft.core.Registry<?>,net.minecraftforge.registries.DeferredRegister<?>>> REGISTRIES
  • Constructor Details

    • ForgePlatformHelper

      public ForgePlatformHelper()
  • Method Details

    • getPlatformName

      public String getPlatformName()
      Description copied from interface: IPlatformHelper
      Gets the name of the current platform
      Specified by:
      getPlatformName in interface IPlatformHelper
      Returns:
      The name of the current platform.
    • isModLoaded

      public boolean isModLoaded(String modId)
      Description copied from interface: IPlatformHelper
      Checks if a mod with the given id is loaded.
      Specified by:
      isModLoaded in interface IPlatformHelper
      Parameters:
      modId - The mod to check if it is loaded.
      Returns:
      True if the mod is loaded, false otherwise.
    • isModEarlyLoaded

      public boolean isModEarlyLoaded(String modId)
      Description copied from interface: IPlatformHelper
      Checks if a mod with the given id is loaded, when we need to check early Such as in mixin config plugin. (Not relevant for Fabric)
      Specified by:
      isModEarlyLoaded in interface IPlatformHelper
      Parameters:
      modId - The mod to check if it is loaded.
      Returns:
      True if the mod is loaded, false otherwise.
    • getResourcePath

      public Path getResourcePath(String modId, String resource)
      Specified by:
      getResourcePath in interface IPlatformHelper
    • isDevelopmentEnvironment

      public boolean isDevelopmentEnvironment()
      Description copied from interface: IPlatformHelper
      Checks if the game is currently in a development environment.
      Specified by:
      isDevelopmentEnvironment in interface IPlatformHelper
      Returns:
      True if in a development environment, false otherwise.
    • register

      public <I, T extends I> Supplier<T> register(net.minecraft.core.Registry<I> registry, String modId, String name, Supplier<T> sup)
      Description copied from interface: IPlatformHelper
      Registers an object
      Specified by:
      register in interface IPlatformHelper
      Returns:
    • addBrewingRecipes

      public static void addBrewingRecipes(net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent event)
    • addMix

      public 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)
      Description copied from interface: IPlatformHelper
      Adds a brewing mix.
      Specified by:
      addMix in interface IPlatformHelper
    • addBrewingRecipe

      public 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)
      Description copied from interface: IPlatformHelper
      Adds a brewing recipe. For brewing that has a non-potion as input or output. Use addMix otherwise.
      Specified by:
      addBrewingRecipe in interface IPlatformHelper
    • addComposting

      public static void addComposting(net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent event)
    • addCompostable

      public void addCompostable(Supplier<? extends net.minecraft.world.level.ItemLike> item, float chance)
      Description copied from interface: IPlatformHelper
      Adds an item to the composter.
      Specified by:
      addCompostable in interface IPlatformHelper
      Parameters:
      item - to be composted.
      chance - to produce a layer in the composter.
    • addFurnaceFuels

      public static void addFurnaceFuels(net.minecraftforge.event.furnace.FurnaceFuelBurnTimeEvent event)
    • registerFuels

      public static void registerFuels(net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent event)
    • addFurnaceFuel

      public void addFurnaceFuel(Supplier<? extends net.minecraft.world.level.ItemLike> item, int burnTime)
      Description copied from interface: IPlatformHelper
      Adds an item as furnace fuel. Use only when getBurnTime somehow isn't available to override.
      Specified by:
      addFurnaceFuel in interface IPlatformHelper
      Parameters:
      item - to be used as fuel
      burnTime - ticks to burn. A standard furnace recipe takes 200 ticks.
    • registerConfig

      public void registerConfig(net.minecraftforge.common.ForgeConfigSpec spec, net.minecraftforge.fml.config.ModConfig.Type type, String modId)
      Description copied from interface: IPlatformHelper
      Registers a config
      Specified by:
      registerConfig in interface IPlatformHelper
      type - Side that the config applies to
    • registerPacks

      public static void registerPacks(net.minecraftforge.event.AddPackFindersEvent event)
    • addPack

      public void addPack(Registration.PackData pack, String modId)
      Description copied from interface: IPlatformHelper
      Registers an addition resource/data pack
      Specified by:
      addPack in interface IPlatformHelper
    • isPhysicalClient

      public boolean isPhysicalClient()
      Description copied from interface: IPlatformHelper
      Whether
      Specified by:
      isPhysicalClient in interface IPlatformHelper
      Returns: