Class EarsStateOverriderRegistry

java.lang.Object
com.unascribed.ears.api.registry.EarsStateOverriderRegistry

public final class EarsStateOverriderRegistry extends Object
  • Method Details

    • register

      public static Cork register(String namespace, EarsStateOverrider overrider)
      Registers a state overrider that will be checked before rendering Ears features.

      This allows you to un-prevent the drawing of Ears features that are normally suppressed by the wearing of certain types of equipment should you want to, or disable detection of various other things. Your StateOverrider will receive two arguments; the type of state being checked, and the "peer" object, which can be safely cast to EntityPlayer (or your mappings' equivalent). The Ears API is provided by Ears common code, which has no access to the EntityPlayer type.

      You can use this to, for example, force claws to render when wearing boots if your mod is causing boots to be hidden.

      Parameters:
      namespace - Your mod's namespace. This is equivalent to "modid".
      overrider - The EarsStateOverrider to register.
      Returns:
      a Cork you can use to unregister this overrider later if needed
    • isActive

      public static Identified<Boolean> isActive(EarsStateType state, Object peer, boolean def)
      Returns:
      true if the given state is active, plus the namespace if an override was applied