Class Capability<T>
java.lang.Object
net.minecraftforge.common.capabilities.Capability<T>
This is the core holder object Capabilities.
 Each capability will have ONE instance of this class,
 and it will the the one passed into the ICapabilityProvider functions.
 The CapabilityManager is in charge of creating this class.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddListener(Consumer<Capability<T>> listener) Adds a listener to be called when someone registers this capability.getName()boolean(package private) void<R> @NotNull LazyOptional<R>orEmpty(Capability<R> toCheck, LazyOptional<T> inst) 
- 
Field Details- 
name
- 
listenersList<Consumer<Capability<T>>> listeners
 
- 
- 
Constructor Details- 
CapabilityCapability(String name) 
 
- 
- 
Method Details- 
getName- Returns:
- The unique name of this capability, typically this is the fully qualified class name for the target interface.
 
- 
orEmpty
- 
isRegisteredpublic boolean isRegistered()- Returns:
- true if something has registered this capability to the Manager. This is a marker that the class for this capability exists, and can be used.
 
- 
addListenerAdds a listener to be called when someone registers this capability. May be called instantly if this is already registered.- Parameters:
- listener- Function to fire when capability is registered.
- Returns:
- self, in case people want to use builder pattern.
 
- 
onRegistervoid onRegister()
 
-