From 66d1faa7e3d8060c18662aa34df2b722e74f5848 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Sat, 22 Apr 2023 12:27:31 -0400 Subject: [PATCH] Fix another logic race that could cause missing models --- .../mixin/perf/dynamic_resources/ModelBakeryMixin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/embeddedt/modernfix/mixin/perf/dynamic_resources/ModelBakeryMixin.java b/src/main/java/org/embeddedt/modernfix/mixin/perf/dynamic_resources/ModelBakeryMixin.java index 7cc79897..8aac2731 100644 --- a/src/main/java/org/embeddedt/modernfix/mixin/perf/dynamic_resources/ModelBakeryMixin.java +++ b/src/main/java/org/embeddedt/modernfix/mixin/perf/dynamic_resources/ModelBakeryMixin.java @@ -366,11 +366,13 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery { ResourceLocation resourcelocation = this.loadingStack.iterator().next(); try { - if (!this.unbakedCache.containsKey(resourcelocation)) { + existing = this.unbakedCache.get(resourcelocation); + if (existing == null) { if(debugDynamicModelLoading) LOGGER.info("Loading {}", resourcelocation); this.loadModel(resourcelocation); - } + } else + smallLoadingCache.put(resourcelocation, existing); } catch (ModelBakery.BlockStateDefinitionException var9) { LOGGER.warn(var9.getMessage()); this.unbakedCache.put(resourcelocation, iunbakedmodel);