Search in sources :

Example 1 with Nullable

use of jline.internal.Nullable in project Overloaded by CJ-MC-Mods.

the class ModelUtils method loadBakedModel.

public static IBakedModel loadBakedModel(ResourceLocation modelLocation) {
    if (!bakedModelCache.containsKey(modelLocation)) {
        try {
            IModel model = ModelLoaderRegistry.getModel(modelLocation);
            IBakedModel bakedModel = model.bake(TRSRTransformation.identity(), DefaultVertexFormats.ITEM, new Function<ResourceLocation, TextureAtlasSprite>() {

                @Nullable
                @Override
                public TextureAtlasSprite apply(ResourceLocation input) {
                    return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
                }
            });
            bakedModelCache.put(modelLocation, bakedModel);
        } catch (Exception e) {
            System.err.println("Error at ModelUtils.loadBakedModel, Resource: " + modelLocation.toString());
            throw new RuntimeException(e);
        }
    }
    return bakedModelCache.get(modelLocation);
}
Also used : IModel(net.minecraftforge.client.model.IModel) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) ResourceLocation(net.minecraft.util.ResourceLocation) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel) Nullable(jline.internal.Nullable)

Aggregations

Nullable (jline.internal.Nullable)1 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)1 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 IModel (net.minecraftforge.client.model.IModel)1