Interface RenderContext.BakedModelConsumer

All Superinterfaces:
Consumer<net.minecraft.client.render.model.BakedModel>
Enclosing interface:
RenderContext

public static interface RenderContext.BakedModelConsumer extends Consumer<net.minecraft.client.render.model.BakedModel>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(net.minecraft.client.render.model.BakedModel model)
    Render a baked model by processing its BakedModel.getQuads(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, java.util.Random) using the rendered block state.
    void
    accept(net.minecraft.client.render.model.BakedModel model, @Nullable net.minecraft.block.BlockState state)
    Render a baked model by processing its BakedModel.getQuads(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, java.util.Random) with an explicit block state.

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Method Details

    • accept

      void accept(net.minecraft.client.render.model.BakedModel model)
      Render a baked model by processing its BakedModel.getQuads(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, java.util.Random) using the rendered block state.

      For block contexts, this will pass the block state being rendered to BakedModel.getQuads(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, java.util.Random). For item contexts, this will pass a null block state to BakedModel.getQuads(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, java.util.Random). accept(BakedModel, BlockState) can be used instead to pass the block state explicitly.

      Specified by:
      accept in interface Consumer<net.minecraft.client.render.model.BakedModel>
    • accept

      void accept(net.minecraft.client.render.model.BakedModel model, @Nullable @Nullable net.minecraft.block.BlockState state)
      Render a baked model by processing its BakedModel.getQuads(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, java.util.Random) with an explicit block state.

      This overload allows passing the block state (or null to query the item quads). This is useful when a model is being wrapped, and expects a different block state than the one of the block being rendered.

      For item render contexts, you can use this function if you want to render the model with a specific block state. Otherwise, use accept(BakedModel) the other overload} to render the usual item quads.