Search in sources :

Example 1 with BakedItemModel

use of net.minecraftforge.client.model.BakedItemModel in project LogisticsPipes by RS485.

the class FluidContainerRenderer method bake.

@Nonnull
@Override
public IBakedModel bake(@Nonnull IModelState state, @Nonnull VertexFormat format, @Nonnull Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
    ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap = PerspectiveMapWrapper.getTransforms(state);
    ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
    IBakedModel model = (new ItemLayerModel(ImmutableList.of(EMPTY))).bake(state, format, bakedTextureGetter);
    builder.addAll(model.getQuads(null, null, 0));
    TextureAtlasSprite particleSprite = model.getParticleTexture();
    return new BakedItemModel(builder.build(), particleSprite, Maps.immutableEnumMap(transformMap), new FluidContainerItemOverrideList(state, format, transformMap, bakedTextureGetter));
}
Also used : TRSRTransformation(net.minecraftforge.common.model.TRSRTransformation) BakedQuad(net.minecraft.client.renderer.block.model.BakedQuad) ImmutableList(com.google.common.collect.ImmutableList) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) ItemLayerModel(net.minecraftforge.client.model.ItemLayerModel) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel) BakedItemModel(net.minecraftforge.client.model.BakedItemModel) Nonnull(javax.annotation.Nonnull)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 Nonnull (javax.annotation.Nonnull)1 BakedQuad (net.minecraft.client.renderer.block.model.BakedQuad)1 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)1 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)1 BakedItemModel (net.minecraftforge.client.model.BakedItemModel)1 ItemLayerModel (net.minecraftforge.client.model.ItemLayerModel)1 TRSRTransformation (net.minecraftforge.common.model.TRSRTransformation)1