Class EarsInhibitorRegistry

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

public final class EarsInhibitorRegistry extends Object
  • Method Details

    • register

      public static Cork register(String namespace, EarsInhibitor inhibitor)
      Registers an inhibitor that will be checked before rendering Ears features.

      This allows you to suppress the drawing of Ears features should you want to. Your Inhibitor will receive two arguments; the type of the feature 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, hide all Ears features when a player is wearing a hermetically sealed suit. The EarsFeatureType enum has an "isAnchoredTo" method you can use to check what part of the body the feature protrudes from.

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

      public static String isInhibited(EarsFeatureType feature, Object peer)
      Returns:
      null if the feature is not inhibited for this peer, otherwise the namespace of the inhibitor