use of org.spongepowered.common.data.persistence.datastore.SpongeDataStoreBuilder in project SpongeCommon by SpongePowered.
the class DataProviderRegistrator method spongeDataStore.
public void spongeDataStore(final ResourceKey datastoreKey, final int version, final DataContentUpdater[] contentUpdater, final Class dataHolder, final Key<? extends Value<?>>... dataKeys) {
final SpongeDataStoreBuilder builder = ((SpongeDataStoreBuilder) DataStore.builder()).pluginData(datastoreKey, version);
builder.updater(contentUpdater);
builder.holder(dataHolder);
for (Key dataKey : dataKeys) {
builder.key(dataKey, dataKey.key().value());
}
SpongeDataManager.getDatastoreRegistry().register(builder.build(), Arrays.asList(dataKeys));
}
Aggregations