Interface ICapabilityProvider<O, C extends @Nullable Object, T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescription@Nullable TgetCapability(O object, C context) Returns the capability, ornullif not available.
-
Method Details
-
getCapability
Returns the capability, ornullif not available.For block entities only: If a previously returned capability is not valid anymore, or if a new capability is available,
ILevelExtension.invalidateCapabilities(BlockPos)MUST be called to notify the caches (seeIBlockCapabilityProvider.getCapability(Level, BlockPos, BlockState, BlockEntity, C)).- Parameters:
object- The object that might provide the capability.context- Extra context, capability-dependent.
-