Package org.spongepowered.api.registry
Interface DefaultedRegistryReference<T>
- Type Parameters:
T
- The type
- All Superinterfaces:
RegistryKey<T>
,RegistryReference<T>
,Supplier<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.registry.RegistryReference
RegistryReference.Factory
-
Method Summary
Methods inherited from interface org.spongepowered.api.registry.RegistryKey
asDefaultedReference, asReference, location, registry
Methods inherited from interface org.spongepowered.api.registry.RegistryReference
find, get
-
Method Details
-
get
T get()Gets the value from the defaultholder
given when constructing this reference.Great care needs to be made in calling this method with any uncertainty as to if this reference will exist in the holder. Should this reference lack a value, a
ValueNotFoundException
will be thrown. Therefore, it is advised to callRegistryReference.find(RegistryHolder...)
instead. -
find
-
defaultHolder
Supplier<RegistryHolder> defaultHolder()
-