From 08be518b5abe8a1052873363506d50845612d7ba Mon Sep 17 00:00:00 2001 From: Una Thompson Date: Wed, 23 Aug 2023 20:37:57 -0700 Subject: [PATCH] Use the set correctly --- .../render/block/entity/BakedBlockEntityRenderer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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);