Skip to content

Commit a526832

Browse files
committed
Fix synchronize return on fail
1 parent cfc2378 commit a526832

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/ChunkMapMixin.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,12 @@ public CompletableFuture<Void> write(final ChunkPos pos, final Supplier<Compound
617617

618618
@Override
619619
public CompletableFuture<Void> synchronize(boolean flush) {
620-
MoonriseRegionFileIO.flush(this.level);
621-
return CompletableFuture.completedFuture(null);
620+
try {
621+
MoonriseRegionFileIO.flush(this.level);
622+
return CompletableFuture.completedFuture(null);
623+
} catch (final Exception ex) {
624+
return CompletableFuture.failedFuture(ex);
625+
}
622626
}
623627

624628
/**

src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/SimpleRegionStorageMixin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,11 @@ private void synchroniseLegacyDataWrite(final LegacyTagFixer instance, final Chu
158158
public CompletableFuture<Void> synchronize(boolean flush) {
159159
try {
160160
this.storage.flush();
161+
return CompletableFuture.completedFuture(null);
161162
} catch (final IOException ex) {
162163
LOGGER.error("Failed to flush chunk storage", ex);
164+
return CompletableFuture.failedFuture(ex);
163165
}
164-
return CompletableFuture.completedFuture(null);
165166
}
166167

167168
/**

0 commit comments

Comments
 (0)