Search in sources :

Example 1 with ModelLoaderErrorMessage

use of net.minecraftforge.logging.ModelLoaderErrorMessage in project MinecraftForge by MinecraftForge.

the class ForgeModelBakery method onPostBakeEvent.

/**
 * Internal, do not use.
 */
public void onPostBakeEvent(Map<ResourceLocation, BakedModel> modelRegistry) {
    BakedModel missingModel = modelRegistry.get(MISSING_MODEL_LOCATION);
    for (Map.Entry<ResourceLocation, Exception> entry : loadingExceptions.entrySet()) {
        // ignoring pure ResourceLocation arguments, all things we care about pass ModelResourceLocation
        if (entry.getKey() instanceof ModelResourceLocation) {
            LOGGER.debug(MODELLOADING, () -> new ModelLoaderErrorMessage((ModelResourceLocation) entry.getKey(), entry.getValue()));
            final ModelResourceLocation location = (ModelResourceLocation) entry.getKey();
            final BakedModel model = modelRegistry.get(location);
            if (model == null) {
                modelRegistry.put(location, missingModel);
            }
        }
    }
    loadingExceptions.clear();
    isLoading = false;
}
Also used : ModelLoaderErrorMessage(net.minecraftforge.logging.ModelLoaderErrorMessage) ResourceLocation(net.minecraft.resources.ResourceLocation) ModelResourceLocation(net.minecraft.client.resources.model.ModelResourceLocation) BakedModel(net.minecraft.client.resources.model.BakedModel) ModelResourceLocation(net.minecraft.client.resources.model.ModelResourceLocation) Map(java.util.Map)

Aggregations

Map (java.util.Map)1 BakedModel (net.minecraft.client.resources.model.BakedModel)1 ModelResourceLocation (net.minecraft.client.resources.model.ModelResourceLocation)1 ResourceLocation (net.minecraft.resources.ResourceLocation)1 ModelLoaderErrorMessage (net.minecraftforge.logging.ModelLoaderErrorMessage)1