BlockApiLookupImpl

public final class BlockApiLookupImpl<A, C> implements BlockApiLookup<A, C>

Functions

apiClass
Link copied to clipboard
Class<AapiClass()
Return the API class of this lookup.
contextClass
Link copied to clipboard
Class<CcontextClass()
Return the context class of this lookup.
find
Link copied to clipboard
@Nullable()
A find(World world, BlockPos pos, C context)
Attempt to retrieve an API from a block in the world.
@Nullable()
A find(World world, BlockPos pos, @Nullable() BlockState state, @Nullable() BlockEntity blockEntity, C context)
Attempt to retrieve an API from a block in the world.
get
Link copied to clipboard
static BlockApiLookup<A, Cget<A, C>(Identifier lookupId, Class<A> apiClass, Class<C> contextClass)
getFallbackProviders
Link copied to clipboard
getProvider
Link copied to clipboard
@Nullable()
BlockApiLookup.BlockApiProvider<A, CgetProvider(Block block)
registerFallback
Link copied to clipboard
void registerFallback(BlockApiLookup.BlockApiProvider<A, C> fallbackProvider)
Expose the API for all queries: the provider will be invoked if no object was found using the block or block entity providers.This may have a big performance impact on all queries, use cautiously.
registerForBlockEntities
Link copied to clipboard
void registerForBlockEntities(BlockApiLookup.BlockEntityApiProvider<A, C> provider, Array<BlockEntityType<? extends Object>> blockEntityTypes)
Expose the API for instances of the passed block entity types.
registerForBlocks
Link copied to clipboard
void registerForBlocks(BlockApiLookup.BlockApiProvider<A, C> provider, Array<Block> blocks)
Expose the API for the passed blocks.
registerSelf
Link copied to clipboard
void registerSelf(Array<BlockEntityType<? extends Object>> blockEntityTypes)
Expose the API for the passed block entities directly implementing it.

Properties

fallbackProviders
Link copied to clipboard
private final List<BlockApiLookup.BlockApiProvider<A, C>> fallbackProviders

Sources

jvm source
Link copied to clipboard