Interface ICapabilityProvider<O,C,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 TypeMethodDescriptiongetCapability
(O object, C context) Returns the capability, ornull
if not available.
-
Method Details
-
getCapability
Returns the capability, ornull
if 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(net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState, net.minecraft.world.level.block.entity.BlockEntity, C)
).- Parameters:
object
- The object that might provide the capability.context
- Extra context, capability-dependent.
-