Skip to content

Commit

Permalink
Prevent scheduleRebuild from being called off-thread (CaffeineMC#2168)
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt authored and jellysquid3 committed Dec 9, 2023
1 parent 27a7d7a commit 686e065
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import me.jellysquid.mods.sodium.client.render.chunk.terrain.TerrainRenderPass;
import me.jellysquid.mods.sodium.client.render.chunk.vertex.format.ChunkMeshFormats;
import me.jellysquid.mods.sodium.client.render.texture.SpriteUtil;
import me.jellysquid.mods.sodium.client.render.util.RenderAsserts;
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;
Expand Down Expand Up @@ -434,6 +435,8 @@ public int getVisibleChunkCount() {
}

public void scheduleRebuild(int x, int y, int z, boolean important) {
RenderAsserts.validateCurrentThread();

this.sectionCache.invalidate(x, y, z);

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

0 comments on commit 686e065

Please sign in to comment.