use of org.spongepowered.common.registry.SpongeRegistryHolder in project SpongeCommon by SpongePowered.
the class AbstractRegisterRegistryEvent method register.
@Override
public <T> RegistryType<T> register(final ResourceKey key, final boolean isDynamic) throws DuplicateRegistrationException {
Objects.requireNonNull(key, "key");
final SpongeRegistryHolder holder = this.getHolder();
final RegistryType<T> type = RegistryType.of(RegistryRoots.SPONGE, key);
holder.createRegistry(type, (RegistryLoader<T>) null, isDynamic);
return type;
}
use of org.spongepowered.common.registry.SpongeRegistryHolder in project SpongeCommon by SpongePowered.
the class AbstractRegisterRegistryEvent method register.
@Override
public <T> RegistryType<T> register(final ResourceKey key, final boolean isDynamic, final Supplier<Map<ResourceKey, T>> defaultValues) throws DuplicateRegistrationException {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(defaultValues, "defaultValues");
final SpongeRegistryHolder holder = this.getHolder();
final RegistryType<T> type = RegistryType.of(RegistryRoots.SPONGE, key);
holder.createRegistry(type, defaultValues, isDynamic);
return type;
}
Aggregations