Class APIProvider

java.lang.Object
etithespirit.orimod.api.APIProvider

public final class APIProvider extends Object
Provides access to a copy of the APIs offered by this mod.
Author:
Eti
  • Method Details

    • isModInstalled

      public static boolean isModInstalled()
      Returns whether or not the Ori mod is installed.
      Returns:
      Whether or not the Ori mod is installed.
    • getSpiritSoundAPI

      public static ISpiritSoundAPI getSpiritSoundAPI()
      Returns an API that allows for custom block/material sound overrides to be registered to Spirits. Use this if you are interested in any of your mod blocks having different sounds when they are stepped on by spirits. This is, of course, purely cosmetic and exists for the sake of immersion.

      An example of when to use this is when looking at a block such as biomesoplenty:flesh. Its defined material for its Block class makes it use SpiritMaterial.WOOL as per the default mapping, which is not fitting. This API could be used to set it to something like SpiritMaterial.SHROOM, which would match the intended material of the block far better than its vanilla material.

      The test order for material overrides is:
      1. Block -> SpiritMaterial Conditional Overrides
      2. Custom Material -> SpiritMaterial Conditional Overrides
      3. BlockState -> SpiritMaterial Bindings
      4. Block -> SpiritMaterial Bindings
      5. Custom Material -> SpiritMaterial Bindings
      6. Vanilla Material -> SpiritMaterial Bindings
      The first one to yield a result is used. If none of these yield a result, the vanilla sound will be passed through.
      Returns:
      The instance of the sound API. If the mod is not installed (and only the API is), then a dummy API will be returned. Use ISpiritSoundAPI.isInstalled() to determine whether or not the returned API is usable, as the dummy API will raise an exception upon calling any of its members.
    • getEnvironmentalAffinityAPI

      public static IEnvironmentalAffinityAPI getEnvironmentalAffinityAPI()
      Returns an instance of the Environmental Affinity API if it exists, or a dummy instance otherwise.
      This API is not ready for use.
      Returns:
      An instance of the Environmental Affinity API if it exists, or a dummy instance otherwise.