Additional logging
This commit is contained in:
parent
16c1d59d20
commit
e8b7bf07b8
1 changed files with 15 additions and 19 deletions
|
@ -18,7 +18,6 @@ import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
|||
import com.google.gson.JsonElement;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
@ -49,10 +48,7 @@ public abstract class RegistriesDataProvider implements DataProvider {
|
|||
|
||||
return registriesFuture.thenCompose(registriesProvider -> CompletableFuture
|
||||
.supplyAsync(() -> registries)
|
||||
.thenCompose(entries -> {
|
||||
final List<CompletableFuture<?>> futures = new ArrayList<>();
|
||||
|
||||
futures.add(CompletableFuture.runAsync(() -> {
|
||||
.thenCompose(entries -> CompletableFuture.runAsync(() -> {
|
||||
registries.acquireLock();
|
||||
final RegistryOps<JsonElement> dynamicOps = RegistryOps.create(
|
||||
JsonOps.INSTANCE,
|
||||
|
@ -65,10 +61,7 @@ public abstract class RegistriesDataProvider implements DataProvider {
|
|||
);
|
||||
}
|
||||
registries.releaseLock();
|
||||
}));
|
||||
|
||||
return CompletableFuture.allOf(futures.toArray(CompletableFuture[]::new));
|
||||
}));
|
||||
})));
|
||||
}
|
||||
|
||||
private <T> void serializeRegistry(
|
||||
|
@ -120,6 +113,9 @@ public abstract class RegistriesDataProvider implements DataProvider {
|
|||
));
|
||||
if (optional.isPresent()) {
|
||||
DataProvider.saveStable(cachedOutput, optional.get(), path);
|
||||
LOGGER.info(path + " written");
|
||||
} else {
|
||||
LOGGER.warning(path + " is empty");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue