RegistryBase

public abstract class RegistryBase<TKey extends Object, TValue extends Object> implements Iterable<Map.Entry<TKey, TValue>>(source)

AvM Staff mod base registration utility. This is not to be confused with Minecraft registries.

Inheritors

Constructors

Link copied to clipboard

Properties

Link copied to clipboard
private final Set<TKey> keys

Gets all the registered keys in this registry.

Functions

Link copied to clipboard
public final Boolean contains(TKey key)

Checks if the given key is present in the registry

Link copied to clipboard
public final TValue get(TKey key)

Gets the value associated with the given key or throws an exception, if the key is not present in this registry.

Link copied to clipboard
public final Set<TKey> getKeys()
Link copied to clipboard
Link copied to clipboard
public Unit register(TKey key, TValue value)

Registers an entry to this registry.

Link copied to clipboard
public Unit validateEntry(TKey key, TValue value)

Validates an entry to be registered. Throws an exception, if the entry is invalid.

Inherited functions

Link copied to clipboard
public Unit forEach(Consumer<? super Entry.Map<TKey, TValue>> p0)
Link copied to clipboard