diff --git a/src/main/java/dev/hephaestus/glowcase/client/render/block/entity/BakedBlockEntityRenderer.java b/src/main/java/dev/hephaestus/glowcase/client/render/block/entity/BakedBlockEntityRenderer.java index 462919f..1d21eea 100644 --- a/src/main/java/dev/hephaestus/glowcase/client/render/block/entity/BakedBlockEntityRenderer.java +++ b/src/main/java/dev/hephaestus/glowcase/client/render/block/entity/BakedBlockEntityRenderer.java @@ -264,7 +264,9 @@ public static void render(WorldRenderContext wrc) { MatrixStack matrices = wrc.matrixStack(); matrices.push(); matrices.translate(-cam.x, -cam.y, -cam.z); - for (Map.Entry entry : regions.object2ReferenceEntrySet()) { + var iter = regions.object2ReferenceEntrySet().iterator(); + while (iter.hasNext()) { + var entry = iter.next(); RenderRegionPos rrp = entry.getKey(); RegionBuffer regionBuffer = entry.getValue(); if (isVisiblePos(entry.getKey(), cam)) { @@ -276,7 +278,7 @@ public static void render(WorldRenderContext wrc) { matrices.pop(); } else { regionBuffer.release(); - regions.remove(rrp); + iter.remove(); } } RenderSystem.setShaderFogEnd(originalFogEnd);