Package xaero.pac.common.capability.api
Interface ICapabilityHelperAPI
public interface ICapabilityHelperAPI
Helper API for getting capability values of objects
-
Method Summary
Modifier and TypeMethodDescription<T,
C extends xaero.pac.common.capability.ICapability<T>>
TgetCapability
(Object object, C capability) Gets the capability value of a specified type for a specified object.
-
Method Details
-
getCapability
@Nullable <T,C extends xaero.pac.common.capability.ICapability<T>> T getCapability(@Nonnull Object object, @Nonnull C capability) Gets the capability value of a specified type for a specified object.Client world capability types can be found in
ClientWorldCapabilityTypes
- Type Parameters:
T
- the type of the capability valueC
- the type of capability types- Parameters:
object
- the object that the capability is attached to, not nullcapability
- the capability type, not null- Returns:
- the capability value attached to the object, null when a capability of the specified type isn't attached to the object
-