Skip to content

Commit f1cd8ba

Browse files
committed
Merge remote-tracking branch 'origin/1.19.2' into 1.19.4
2 parents a1f3cb9 + 6020ff7 commit f1cd8ba

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

common/src/main/java/org/embeddedt/modernfix/dynamicresources/ModelBakeryHelpers.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
import com.google.common.base.Splitter;
44
import com.google.common.collect.ImmutableList;
5-
import net.minecraft.client.resources.model.ModelResourceLocation;
5+
import com.mojang.datafixers.util.Pair;
6+
import net.minecraft.client.resources.model.*;
7+
import net.minecraft.resources.ResourceLocation;
68
import net.minecraft.world.level.block.Block;
79
import net.minecraft.world.level.block.state.BlockState;
810
import net.minecraft.world.level.block.state.StateDefinition;
911
import net.minecraft.world.level.block.state.properties.Property;
12+
import org.embeddedt.modernfix.api.entrypoint.ModernFixClientIntegration;
1013

1114
import java.util.*;
15+
import java.util.function.BiFunction;
1216

1317
public class ModelBakeryHelpers {
1418
/**
@@ -78,4 +82,13 @@ public static ImmutableList<BlockState> getBlockStatesForMRL(StateDefinition<Blo
7882
}
7983
return ImmutableList.copyOf(finalList);
8084
}
85+
86+
public static ModernFixClientIntegration bakedModelWrapper(BiFunction<ResourceLocation, Pair<UnbakedModel, BakedModel>, BakedModel> consumer) {
87+
return new ModernFixClientIntegration() {
88+
@Override
89+
public BakedModel onBakedModelLoad(ResourceLocation location, UnbakedModel baseModel, BakedModel originalModel, ModelState state, ModelBakery bakery) {
90+
return consumer.apply(location, Pair.of(baseModel, originalModel));
91+
}
92+
};
93+
}
8194
}

0 commit comments

Comments
 (0)