From 8ea1d1cfba7f086a88647d23f73af9cefa9a02fc Mon Sep 17 00:00:00 2001 From: UnlikePaladin <36827970+UnlikePaladin@users.noreply.github.com> Date: Thu, 28 Dec 2023 19:24:30 -0600 Subject: [PATCH] Fix a possible concurrent modification --- .../pfm/blocks/models/forge/PFMForgeBakedModel.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/forge/src/main/java/com/unlikepaladin/pfm/blocks/models/forge/PFMForgeBakedModel.java b/forge/src/main/java/com/unlikepaladin/pfm/blocks/models/forge/PFMForgeBakedModel.java index 858942135..43cd1a489 100644 --- a/forge/src/main/java/com/unlikepaladin/pfm/blocks/models/forge/PFMForgeBakedModel.java +++ b/forge/src/main/java/com/unlikepaladin/pfm/blocks/models/forge/PFMForgeBakedModel.java @@ -60,8 +60,11 @@ public List getQuadsWithTexture(List quads, List t for (BakedQuad quad : quads) { Identifier sprite = quad.getSprite().getId(); if (separatedQuads.containsKey(sprite)) { - if (!separatedQuads.get(sprite).contains(quad)) - separatedQuads.get(sprite).add(quad); + if (!separatedQuads.get(sprite).contains(quad)) { + List newQuadList = new ArrayList<>(separatedQuads.get(sprite)); + newQuadList.add(quad); + separatedQuads.put(sprite, newQuadList); + } continue; } List list = new ArrayList<>();