public interface ICapabilityProvider
Modifier and Type | Method and Description |
---|---|
<T> T |
getCapability(Capability<T> capability,
EnumFacing facing)
Retrieves the handler for the capability requested on the specific side.
|
boolean |
hasCapability(Capability<?> capability,
EnumFacing facing)
Determines if this object has support for the capability in question on the specific side.
|
boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing facing)
getCapability(Capability, EnumFacing)
.
Basically, this method functions analogously to Map.containsKey(Object)
.
Example: A Pipe getting a cover placed on one side causing it lose the Inventory attachment function for that side.
This is a light weight version of getCapability, intended for metadata uses.
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'getCapability(Capability, EnumFacing)
must not return null.@Nullable <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing)
Basically, this method functions analogously to Map.get(Object)
.
capability
- The capability to checkfacing
- The Side to check from,
CAN BE NULL. Null is defined to represent 'internal' or 'self'hasCapability(Capability, EnumFacing)
would return true.