From 9f56c913fabe7a919201f5cd4047944307dd03be Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Sun, 22 Mar 2026 22:14:54 -0400 Subject: [PATCH] Reduce redundant suspension checks --- .../mixin/perf/release_protochunks/ChunkHolderMixin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/embeddedt/modernfix/common/mixin/perf/release_protochunks/ChunkHolderMixin.java b/src/main/java/org/embeddedt/modernfix/common/mixin/perf/release_protochunks/ChunkHolderMixin.java index fa1401c3..e72084f5 100644 --- a/src/main/java/org/embeddedt/modernfix/common/mixin/perf/release_protochunks/ChunkHolderMixin.java +++ b/src/main/java/org/embeddedt/modernfix/common/mixin/perf/release_protochunks/ChunkHolderMixin.java @@ -68,7 +68,9 @@ public abstract class ChunkHolderMixin extends GenerationChunkHolder implements // register for suspension check when chain completes var map = ((ISuspendedHolderTrackingChunkMap)this.playerProvider); this.saveSync.whenCompleteAsync((r, e) -> { - map.mfix$markForSuspensionCheck(this.pos); + if (this.getLatestChunk() != null) { + map.mfix$markForSuspensionCheck(this.pos); + } }, map.mfix$getMainThreadExecutor()); } }