Skip to content

Commit fb72078

Browse files
committed
Merge 1.16 into 1.18
2 parents 9c02b2c + 36673f2 commit fb72078

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

forge/src/main/java/org/embeddedt/modernfix/forge/mixin/perf/dynamic_resources/ModelBakeryMixin.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import java.util.*;
5454
import java.util.concurrent.TimeUnit;
5555
import java.util.function.BiConsumer;
56+
import java.util.function.Consumer;
5657
import java.util.function.Function;
5758
import java.util.stream.Stream;
5859

@@ -209,13 +210,11 @@ private void gatherModelMaterials(Set<Material> materialSet) {
209210
loadedModels.put(MISSING_MODEL_LOCATION, missingModel);
210211
}
211212

212-
@Inject(method = "uploadTextures", at = @At(value = "FIELD", target = "Lnet/minecraft/client/resources/model/ModelBakery;topLevelModels:Ljava/util/Map;", ordinal = 0), cancellable = true)
213-
private void skipBake(TextureManager resourceManager, ProfilerFiller profiler, CallbackInfoReturnable<AtlasSet> cir) {
214-
profiler.pop();
213+
@Redirect(method = "uploadTextures", at = @At(value = "INVOKE", target = "Ljava/util/Set;forEach(Ljava/util/function/Consumer;)V", ordinal = 0))
214+
private void skipBake(Set instance, Consumer consumer, TextureManager resourceManager, ProfilerFiller profiler) {
215215
// ensure missing model is a permanent override
216216
this.bakedTopLevelModels.put(MISSING_MODEL_LOCATION, this.bake(MISSING_MODEL_LOCATION, BlockModelRotation.X0_Y0, this.atlasSet::getSprite));
217217
DynamicBakedModelProvider.currentInstance = (DynamicBakedModelProvider)this.bakedTopLevelModels;
218-
cir.setReturnValue(atlasSet);
219218
}
220219

221220
/**

0 commit comments

Comments
 (0)