Sable ignores the flush parameter (bl) in ServerLevelMixin when saving sublevels, causing the game to write sublevel data to disk every save. Vanilla avoids writing chunks to disk when this parameter is false. Ideally Sable would only attempt to write data when flush is true as IO can be expensive, especially on older systems with mechanical drives.
|
@Inject(method = "save", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;saveLevelData()V", shift = At.Shift.BEFORE)) |
|
public void sable$saveSubLevels(final ProgressListener progressListener, final boolean bl, final boolean bl2, final CallbackInfo ci) { |
|
final ServerLevel self = (ServerLevel) (Object) this; |
|
if (progressListener != null) { |
|
progressListener.progressStartNoAbort(Component.translatable("menu.savingSubLevels")); |
|
} |
|
|
|
final ServerSubLevelContainer container = SubLevelContainer.getContainer(self); |
|
assert container != null : "No sub-level container"; |
|
|
|
final SubLevelHoldingChunkMap holdingChunkMap = container.getHoldingChunkMap(); |
|
holdingChunkMap.saveAll(); |
|
} |
This is likely related to
#739
Sable ignores the
flushparameter (bl) in ServerLevelMixin when saving sublevels, causing the game to write sublevel data to disk every save. Vanilla avoids writing chunks to disk when this parameter is false. Ideally Sable would only attempt to write data whenflushis true as IO can be expensive, especially on older systems with mechanical drives.sable/common/src/main/java/dev/ryanhcode/sable/mixin/plot/ServerLevelMixin.java
Lines 66 to 78 in 6f2b321
This is likely related to #739