diff --git a/fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakeryMixin.java b/fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakeryMixin.java index 6d67cfef..58474c27 100644 --- a/fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakeryMixin.java +++ b/fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakeryMixin.java @@ -48,6 +48,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.*; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collector; @@ -279,9 +280,8 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery { this.topLevelModels.entrySet().removeIf(isVanillaModel); } - @Inject(method = "uploadTextures", at = @At(value = "FIELD", target = "Lnet/minecraft/client/resources/model/ModelBakery;topLevelModels:Ljava/util/Map;", ordinal = 0), cancellable = true) - private void skipBake(TextureManager resourceManager, ProfilerFiller profiler, CallbackInfoReturnable cir) { - profiler.pop(); + @Redirect(method = "uploadTextures", at = @At(value = "INVOKE", target = "Ljava/util/Set;forEach(Ljava/util/function/Consumer;)V", ordinal = 0)) + private void skipBake(Set instance, Consumer consumer, TextureManager resourceManager, ProfilerFiller profiler) { this.inTextureGatheringPass = false; this.injectedModels = null; // hand off to the dynamic model system @@ -324,7 +324,6 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery { this.topLevelModels.clear(); this.topLevelModels.put(MISSING_MODEL_LOCATION, this.missingModel); this.smallLoadingCache.clear(); - cir.setReturnValue(atlasSet); } /**