Interface RegisterRegistryEvent
-
- All Superinterfaces:
Event
,LifecycleEvent
- All Known Subinterfaces:
RegisterRegistryEvent.EngineScoped<E>
,RegisterRegistryEvent.GameScoped
,RegisterRegistryEvent.WorldScoped
public interface RegisterRegistryEvent extends LifecycleEvent
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RegisterRegistryEvent.EngineScoped<E extends Engine>
static interface
RegisterRegistryEvent.GameScoped
static interface
RegisterRegistryEvent.WorldScoped
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> RegistryType<T>
register(ResourceKey key, boolean isDynamic)
Registers a newRegistry
.<T> RegistryType<T>
register(ResourceKey key, boolean isDynamic, java.util.function.Supplier<java.util.Map<ResourceKey,T>> defaultValues)
Registers a newRegistry
.-
Methods inherited from interface org.spongepowered.api.event.lifecycle.LifecycleEvent
game
-
-
-
-
Method Detail
-
register
<T> RegistryType<T> register(ResourceKey key, boolean isDynamic) throws DuplicateRegistrationException
Registers a newRegistry
.- Parameters:
key
- The key for the registryisDynamic
- If this registry will support additional registrations after the lifecycle- Throws:
DuplicateRegistrationException
- If the type is already registered
-
register
<T> RegistryType<T> register(ResourceKey key, boolean isDynamic, java.util.function.Supplier<java.util.Map<ResourceKey,T>> defaultValues) throws DuplicateRegistrationException
Registers a newRegistry
.- Parameters:
key
- The key for the registryisDynamic
- If this registry will support additional registrations after the lifecycledefaultValues
- The values to populate the registry with- Throws:
DuplicateRegistrationException
- If the type is already registered
-
-