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);
}
Aggregations