From 6665db3a69032e4c07465fc3052d9ce0c07d81ed Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Fri, 28 Apr 2023 22:34:44 -0400 Subject: [PATCH] Only use the fallback path for models/blockstates not discovered yet --- .../mixin/perf/dynamic_resources/ModelBakeryMixin.java | 4 ++++ 1 file changed, 4 insertions(+) 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 51efcde1..a68bd3d5 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 @@ -260,6 +260,8 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery { frm.add(allPackResources.get(i)); } for(ResourceLocation blockstate : blockStateFiles) { + if(allAvailableStates.contains(blockstate)) + continue; // don't check ones we know exist ResourceLocation fileLocation = new ResourceLocation(blockstate.getNamespace(), "blockstates/" + blockstate.getPath() + ".json"); try(Resource resource = frm.getResource(fileLocation)) { allAvailableStates.add(blockstate); @@ -267,6 +269,8 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery { } } for(ResourceLocation model : modelFiles) { + if(allAvailableModels.contains(model)) + continue; // don't check ones we know exist ResourceLocation fileLocation = new ResourceLocation(model.getNamespace(), "models/" + model.getPath() + ".json"); try(Resource resource = frm.getResource(fileLocation)) { allAvailableModels.add(model);