Package org.spongepowered.api.registry
Interface RegistryReference<T>
- Type Parameters:
T
- The type
- All Superinterfaces:
RegistryKey<T>
- All Known Subinterfaces:
DefaultedRegistryReference<T>
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionfind
(RegistryHolder... holders) Gets the value from theholders
.get
(RegistryHolder... holders) Gets the value from theholders
.static <T> RegistryReference
<T> referenced
(RegistryHolder holder, RegistryType<T> registry, T value) Methods inherited from interface org.spongepowered.api.registry.RegistryKey
asDefaultedReference, asReference, location, registry
-
Method Details
-
referenced
static <T> RegistryReference<T> referenced(RegistryHolder holder, RegistryType<T> registry, T value) -
get
Gets the value from theholders
.Behavior wise, the first holder that has a type of
registry
within will be queried for this reference. If the registry is present, no additional holders will be queried.Great care needs to be made in calling this method with any uncertainty as to if this reference will exist in the holders. Should this reference lack a value, a
will be thrown. Therefore, it is advised to callValueNotFoundException
find(RegistryHolder...)
instead.- Parameters:
holders
- The holders to look against- Returns:
- The value
-
find
Gets the value from theholders
.Behavior wise, the first holder that has a type of
registry
within will be queried for this reference. If the registry is present, no additional holders will be queried.- Parameters:
holders
- The holders to look against- Returns:
- The value
-