actually rollback on error in registry events.
Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
parent
749c9063af
commit
cf3e9d1e0c
1 changed files with 4 additions and 3 deletions
|
@ -374,11 +374,12 @@ public class GameData
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CompletableFuture<List<Throwable>> checkForRevertToVanilla(final Executor executor, final CompletableFuture<List<Throwable>> listCompletableFuture) {
|
public static CompletableFuture<List<Throwable>> checkForRevertToVanilla(final Executor executor, final CompletableFuture<List<Throwable>> listCompletableFuture) {
|
||||||
return listCompletableFuture.thenApplyAsync(errors -> {
|
return listCompletableFuture.whenCompleteAsync((errors, except) -> {
|
||||||
if (!errors.isEmpty()) {
|
if (except != null) {
|
||||||
|
LOGGER.fatal("Detected errors during registry event dispatch, rolling back to VANILLA state");
|
||||||
revertTo(RegistryManager.VANILLA, false);
|
revertTo(RegistryManager.VANILLA, false);
|
||||||
|
LOGGER.fatal("Detected errors during registry event dispatch, roll back to VANILLA complete");
|
||||||
}
|
}
|
||||||
return errors;
|
|
||||||
}, executor);
|
}, executor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue