Fixed missing models with optifine

This commit is contained in:
paulevsGitch 2021-08-01 17:56:09 +03:00
parent 427ae65856
commit ceea648858

View file

@ -50,8 +50,8 @@ public abstract class ModelBakeryMixin {
} }
// If Injection above failed - with Optifine, for example // If Injection above failed - with Optifine, for example
@Inject(method = "getModel", at = @At("HEAD")) @Inject(method = "loadModel(Lnet/minecraft/resources/ResourceLocation;)V", at = @At("HEAD"))
private void bclib_loadModelsIfNecessary(ResourceLocation resourceLocation, CallbackInfoReturnable<UnbakedModel> model) { private void bclib_loadModelsIfNecessary(ResourceLocation resourceLocation, CallbackInfo model) {
if (!CustomModelBakery.areModelsLoaded()) { if (!CustomModelBakery.areModelsLoaded()) {
ResourceManager resourceManager = Minecraft.getInstance().getResourceManager(); ResourceManager resourceManager = Minecraft.getInstance().getResourceManager();
CustomModelBakery.loadCustomModels(resourceManager, unbakedCache, topLevelModels, loadingStack); CustomModelBakery.loadCustomModels(resourceManager, unbakedCache, topLevelModels, loadingStack);