Skip to content

Commit

Permalink
Reject enhanced for, return to iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
quat1024 committed Aug 24, 2023
1 parent 5116eef commit 2f1a3f0
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import it.unimi.dsi.fastutil.objects.Object2ReferenceMap;
import it.unimi.dsi.fastutil.objects.Object2ReferenceOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import it.unimi.dsi.fastutil.objects.Reference2ReferenceMap;
import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
Expand Down Expand Up @@ -264,10 +265,13 @@ public static void render(WorldRenderContext wrc) {
MatrixStack matrices = wrc.matrixStack();
matrices.push();
matrices.translate(-cam.x, -cam.y, -cam.z);
for (Map.Entry<RenderRegionPos, RegionBuffer> entry : regions.object2ReferenceEntrySet()) {
ObjectIterator<Map.Entry<RenderRegionPos, RegionBuffer>> regionerator = regions.entrySet().iterator();
while(regionerator.hasNext()) {
Map.Entry<RenderRegionPos, RegionBuffer> entry = regionerator.next();

RenderRegionPos rrp = entry.getKey();
RegionBuffer regionBuffer = entry.getValue();
if (isVisiblePos(entry.getKey(), cam)) {
if (isVisiblePos(rrp, cam) && rrp.origin != null) {
// Iterate over used render layers in the region, render them
matrices.push();
matrices.translate(rrp.origin.getX(), rrp.origin.getY(), rrp.origin.getZ());
Expand All @@ -276,7 +280,7 @@ public static void render(WorldRenderContext wrc) {
matrices.pop();
} else {
regionBuffer.release();
regions.remove(rrp);
regionerator.remove();
}
}
RenderSystem.setShaderFogEnd(originalFogEnd);
Expand Down

0 comments on commit 2f1a3f0

Please sign in to comment.