From 686e06528df2cf14fbd55f8f585103b37cfbf37c Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Fri, 8 Dec 2023 22:43:42 -0500 Subject: [PATCH] Prevent `scheduleRebuild` from being called off-thread (#2168) --- .../mods/sodium/client/render/chunk/RenderSectionManager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/RenderSectionManager.java b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/RenderSectionManager.java index a3380f051b..0376e27b95 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/RenderSectionManager.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/RenderSectionManager.java @@ -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; @@ -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));