Skip to content

Commit c87dee4

Browse files
committed
Merge 1.18 into 1.19.2
2 parents c387e91 + fb72078 commit c87dee4

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
@@ -57,6 +57,7 @@
5757
import java.util.*;
5858
import java.util.concurrent.TimeUnit;
5959
import java.util.function.BiConsumer;
60+
import java.util.function.Consumer;
6061
import java.util.function.Function;
6162
import java.util.stream.Stream;
6263

@@ -217,13 +218,11 @@ private void gatherModelMaterials(Set<Material> materialSet) {
217218
loadedModels.put(MISSING_MODEL_LOCATION, missingModel);
218219
}
219220

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

229228
/**

0 commit comments

Comments
 (0)