Skip to content

Commit

Permalink
Fix updates submitted during initial builds not being processed
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Sep 24, 2023
1 parent 81b3e6e commit e2bcb9e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import me.jellysquid.mods.sodium.client.render.viewport.CameraTransform;
import me.jellysquid.mods.sodium.client.render.viewport.Viewport;
import me.jellysquid.mods.sodium.client.util.MathUtil;
import me.jellysquid.mods.sodium.client.util.task.CancellationToken;
import me.jellysquid.mods.sodium.client.world.WorldSlice;
import me.jellysquid.mods.sodium.client.world.cloned.ChunkRenderContext;
import me.jellysquid.mods.sodium.client.world.cloned.ClonedChunkSectionCache;
Expand Down Expand Up @@ -438,7 +439,7 @@ public void scheduleRebuild(int x, int y, int z, boolean important) {

RenderSection section = this.sectionByPosition.get(ChunkSectionPos.asLong(x, y, z));

if (section != null && section.isBuilt()) {
if (section != null) {
ChunkUpdateType pendingUpdate;

if (allowImportantRebuilds() && (important || this.shouldPrioritizeRebuild(section))) {
Expand All @@ -451,6 +452,12 @@ public void scheduleRebuild(int x, int y, int z, boolean important) {
section.setPendingUpdate(pendingUpdate);

this.needsUpdate = true;

CancellationToken token = section.getBuildCancellationToken();
if(token != null) {
token.setCancelled();
section.setBuildCancellationToken(null); // to allow queuing it again
}
}
}
}
Expand Down

0 comments on commit e2bcb9e

Please sign in to comment.