Interface RegisterRegistryEvent
- All Superinterfaces:
Event,LifecycleEvent
- All Known Subinterfaces:
RegisterRegistryEvent.EngineScoped<E>,RegisterRegistryEvent.GameScoped,RegisterRegistryEvent.WorldScoped
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRegisterRegistryEvent.EngineScoped<E extends Engine>static interfacestatic interface -
Method Summary
Modifier and TypeMethodDescription<T> RegistryType<T>register(ResourceKey key, boolean isDynamic) Registers a newRegistry.<T> RegistryType<T>register(ResourceKey key, boolean isDynamic, Supplier<Map<ResourceKey, T>> defaultValues) Registers a newRegistry.Methods inherited from interface org.spongepowered.api.event.lifecycle.LifecycleEvent
game
-
Method Details
-
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, Supplier<Map<ResourceKey, T>> defaultValues) throws DuplicateRegistrationExceptionRegisters 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
-