From 77e21751239f7adcd8408d2367ca9f2492f69e79 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Thu, 4 May 2023 21:54:57 -0400 Subject: [PATCH] Fix material cache on Fabric Fixes #72 --- .../mixin/perf/cache_model_materials/VanillaModelMixin.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/cache_model_materials/VanillaModelMixin.java b/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/cache_model_materials/VanillaModelMixin.java index 96c455fe..5b8fe094 100644 --- a/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/cache_model_materials/VanillaModelMixin.java +++ b/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/cache_model_materials/VanillaModelMixin.java @@ -4,8 +4,6 @@ import com.mojang.datafixers.util.Pair; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.resources.model.UnbakedModel; import net.minecraft.client.resources.model.Material; -import net.minecraft.client.renderer.block.model.MultiVariant; -import net.minecraft.client.renderer.block.model.multipart.MultiPart; import net.minecraft.resources.ResourceLocation; import org.embeddedt.modernfix.annotation.ClientOnlyMixin; import org.embeddedt.modernfix.duck.ICachedMaterialsModel; @@ -19,7 +17,8 @@ import java.util.Collections; import java.util.Set; import java.util.function.Function; -@Mixin(value = {MultiVariant.class, MultiPart.class, BlockModel.class}) +/* only cache BlockModel to prevent issues with CTM on Fabric */ +@Mixin(value = {BlockModel.class}) @ClientOnlyMixin public class VanillaModelMixin implements ICachedMaterialsModel { private Collection materialsCache = null;