Package org.spongepowered.api.registry
Interface RegistryHolder
- All Known Subinterfaces:
Client
,ClientWorld
,Engine
,Game
,LocalServer
,Server
,ServerWorld
,World<W,
L>
public interface RegistryHolder
A holder of
registries
.-
Method Summary
Modifier and TypeMethodDescriptionfindRegistry
(RegistryType<T> type) <T> Registry<T>
registry
(RegistryType<T> type) streamRegistries
(ResourceKey root) Gets aStream
of theregistries
in this holder within a root.
-
Method Details
-
registry
Gets theRegistry
by akey
.Great care needs to be made in calling this method with any uncertainty as to if the key will exist in the holder. Should the key lack a value, a
ValueNotFoundException
will be thrown. Therefore, it is advised to callfindRegistry(RegistryType)
instead.- Type Parameters:
T
- The type- Parameters:
type
- The type- Returns:
- The registry
-
findRegistry
- Type Parameters:
T
- The type- Parameters:
type
- The type- Returns:
- The registry or
Optional.empty()
-
streamRegistries
Gets aStream
of theregistries
in this holder within a root.- Parameters:
root
- The root to stream registries of- Returns:
- The stream
-