From c678ebbb918e25a2c28e0e2a638b4e837491c0a7 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Thu, 4 Jan 2024 20:30:13 -0500 Subject: [PATCH] Avoid refresh loop if no model data needs refreshing --- .../model_data_manager_cme/ModelDataManagerMixin.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/forge/src/main/java/org/embeddedt/modernfix/forge/mixin/bugfix/model_data_manager_cme/ModelDataManagerMixin.java b/forge/src/main/java/org/embeddedt/modernfix/forge/mixin/bugfix/model_data_manager_cme/ModelDataManagerMixin.java index 45836c897..ebca16443 100644 --- a/forge/src/main/java/org/embeddedt/modernfix/forge/mixin/bugfix/model_data_manager_cme/ModelDataManagerMixin.java +++ b/forge/src/main/java/org/embeddedt/modernfix/forge/mixin/bugfix/model_data_manager_cme/ModelDataManagerMixin.java @@ -6,6 +6,7 @@ import net.minecraft.world.level.Level; import net.minecraftforge.client.model.ModelDataManager; import org.embeddedt.modernfix.annotation.ClientOnlyMixin; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -13,6 +14,7 @@ import org.spongepowered.asm.mixin.injection.Redirect; import java.util.Collections; +import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; @@ -27,6 +29,8 @@ public abstract class ModelDataManagerMixin { throw new AssertionError(); } + @Shadow @Final private static Map> needModelDataRefresh; + /** * Make the set of positions to refresh a real concurrent hash set rather than relying on synchronizedSet, * because the returned iterator won't be thread-safe otherwise. See https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/7511 @@ -40,7 +44,8 @@ private static Function> changeTypeOfSetUsed(Function