Package org.empirewar.orbis.registry
Interface ResolvableRegistry<T extends RegistryResolvable<K>,K>
- All Superinterfaces:
Iterable<T>,net.kyori.adventure.key.Keyed,OrbisRegistry<T,K>
- All Known Implementing Classes:
ResolvableStringOrbisRegistry
public non-sealed interface ResolvableRegistry<T extends RegistryResolvable<K>,K>
extends OrbisRegistry<T,K>
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidA convenience overload ofresolve(Object, Consumer, RegistryLifecycle)which uses the registry's current lifecycle.voidresolve(K key, Consumer<T> entry, RegistryLifecycle waitFor) Resolves a single entry in this registry.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface net.kyori.adventure.key.Keyed
keyMethods inherited from interface org.empirewar.orbis.registry.OrbisRegistry
get, getAll, getCodec, getKey, getKeys, getLifecycle, register, setLifecycle, unregister
-
Method Details
-
resolve
Resolves a single entry in this registry.If the entry is already present in the registry, it will be passed to the consumer immediately. If the entry is not present, and the registry is not frozen, the consumer will be registered with the registry's resolver list, and will be passed the entry when it is registered.
If the registry has already passed the specified lifecycle, this method will throw an
IllegalStateException.- Parameters:
key- the key of the entry to resolveentry- the consumer to accept the entrywaitFor- the lifecycle to wait in for which the entry is valid
-
resolve
A convenience overload ofresolve(Object, Consumer, RegistryLifecycle)which uses the registry's current lifecycle.- Parameters:
key- the key of the entry to resolveentry- the consumer to accept the entry
-