Search in sources :

Example 1 with DataCache

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();
}
Also used : DataProvider(net.minecraft.data.DataProvider) Stopwatch(com.google.common.base.Stopwatch) DataCache(net.minecraft.data.DataCache)

Aggregations

Stopwatch (com.google.common.base.Stopwatch)1 DataCache (net.minecraft.data.DataCache)1 DataProvider (net.minecraft.data.DataProvider)1