Package com.unascribed.ears.api.registry
Class EarsInhibitorRegistry
java.lang.Object
com.unascribed.ears.api.registry.EarsInhibitorRegistry
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringisInhibited(EarsFeatureType feature, Object peer) static Corkregister(String namespace, EarsInhibitor inhibitor) Registers an inhibitor that will be checked before rendering Ears features.
-
Method Details
-
register
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 featurebeing 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
- Returns:
nullif the feature is not inhibited for this peer, otherwise the namespace of the inhibitor
-