Interface ICapabilityHelperAPI


public interface ICapabilityHelperAPI
Helper API for getting capability values of objects
  • Method Summary

    Modifier and Type
    Method
    Description
    <T, C extends xaero.pac.common.capability.ICapability<T>>
    T
    getCapability(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 value
      C - the type of capability types
      Parameters:
      object - the object that the capability is attached to, not null
      capability - 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