use of net.minecraft.data.DataCache in project frame-fabric by moddingplayground.
the class DataGeneratorMixin method run.
// Mixin's powers are beyond that of IntelliJ
@SuppressWarnings("ConstantConditions")
@Override
public void run(Consumer<DataCacheAccess> configure) throws IOException {
DataCache dataCache = new DataCache(getOutput(), "cache");
configure.accept((DataCacheAccess) dataCache);
Stopwatch allSw = Stopwatch.createStarted();
Stopwatch providerSw = Stopwatch.createUnstarted();
LOGGER.info("Starting providers...");
for (DataProvider provider : providers) {
LOGGER.info(" Starting provider: {}", provider.getName());
providerSw.start();
provider.run(dataCache);
providerSw.stop();
LOGGER.info(" {} finished after {} ms", provider.getName(), providerSw.elapsed(TimeUnit.MILLISECONDS));
providerSw.reset();
}
LOGGER.info("All providers took: {} ms", allSw.elapsed(TimeUnit.MILLISECONDS));
dataCache.write();
}
Aggregations