ApiLookupMap

public interface ApiLookupMap<L> implements Iterable<L>

A a map meant to be used as the backing storage for custom {@code ApiLookup} instances, to implement a custom equivalent of BlockApiLookup#get.

Usage ExampleWe will be implementing the following simplified version of an API lookup interface for item stacks to illustrate how to use ApiLookupMap and ApiProviderMap.
{@code * public interface ItemStackApiLookup{
 *     static
All the implementation can fit in a single class:
 apiClass, Class, contextClass) {
 *         // Null checks are already handled by ApiLookupMap#get.
 *         return (ItemStackApiLookup

Parameters

<L>

The type of the lookup implementation, similar to the existing BlockApiLookup.

Types

LookupFactory
Link copied to clipboard
public interface LookupFactory<L>

Functions

create
Link copied to clipboard
static ApiLookupMap<Lcreate<L>(ApiLookupMap.LookupFactory<L> lookupFactory)
Create a new instance.
forEach
Link copied to clipboard
void forEach(Consumer<? extends Object> action)
getLookup
Link copied to clipboard
abstract L getLookup(Identifier lookupId, Class<? extends Object> apiClass, Class<? extends Object> contextClass)
Retrieve the API lookup associated with an identifier.
iterator
Link copied to clipboard
abstract Iterator<Titerator()
spliterator
Link copied to clipboard
Spliterator<Tspliterator()

Inheritors

ApiLookupMapImpl
Link copied to clipboard

Sources

jvm source
Link copied to clipboard