Class QuadBakingVertexConsumer

java.lang.Object
net.neoforged.neoforge.client.model.pipeline.QuadBakingVertexConsumer
All Implemented Interfaces:
com.mojang.blaze3d.vertex.VertexConsumer, IVertexConsumerExtension

public class QuadBakingVertexConsumer extends Object implements com.mojang.blaze3d.vertex.VertexConsumer
Vertex consumer that outputs baked quads.

This consumer accepts data in DefaultVertexFormat.BLOCK and is not picky about ordering or missing elements, but will not automatically populate missing data (color will be black, for example).

Built quads must be retrieved after building four vertices

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
     
    private net.minecraft.core.Direction
     
    private final Map<com.mojang.blaze3d.vertex.VertexFormatElement,Integer>
     
    private boolean
     
    private int
     
    private static final int
     
    private final int[]
     
    private boolean
     
    private net.minecraft.client.renderer.texture.TextureAtlasSprite
     
    private int
     
    private int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.mojang.blaze3d.vertex.VertexConsumer
    addVertex(float x, float y, float z)
     
    net.minecraft.client.renderer.block.model.BakedQuad
     
    com.mojang.blaze3d.vertex.VertexConsumer
    misc(com.mojang.blaze3d.vertex.VertexFormatElement element, int... rawData)
    Consumes an unknown VertexFormatElement as a raw int data array.
    com.mojang.blaze3d.vertex.VertexConsumer
    setColor(int r, int g, int b, int a)
     
    void
    setDirection(net.minecraft.core.Direction direction)
     
    void
    setHasAmbientOcclusion(boolean hasAmbientOcclusion)
     
    void
    setLightEmission(int lightEmission)
     
    com.mojang.blaze3d.vertex.VertexConsumer
    setNormal(float x, float y, float z)
     
    void
    setShade(boolean shade)
     
    void
    setSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
     
    void
    setTintIndex(int tintIndex)
     
    com.mojang.blaze3d.vertex.VertexConsumer
    setUv(float u, float v)
     
    com.mojang.blaze3d.vertex.VertexConsumer
    setUv1(int u, int v)
     
    com.mojang.blaze3d.vertex.VertexConsumer
    setUv2(int u, int v)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.neoforged.neoforge.client.extensions.IVertexConsumerExtension

    applyBakedLighting, applyBakedNormals, putBulkData

    Methods inherited from interface com.mojang.blaze3d.vertex.VertexConsumer

    addVertex, addVertex, addVertex, addVertex, addVertex, putBulkData, putBulkData, setColor, setColor, setLight, setNormal, setNormal, setOverlay, setWhiteAlpha
  • Field Details

    • ELEMENT_OFFSETS

      private final Map<com.mojang.blaze3d.vertex.VertexFormatElement,Integer> ELEMENT_OFFSETS
    • QUAD_DATA_SIZE

      private static final int QUAD_DATA_SIZE
    • quadData

      private final int[] quadData
    • vertexIndex

      private int vertexIndex
    • building

      private boolean building
    • tintIndex

      private int tintIndex
    • direction

      private net.minecraft.core.Direction direction
    • sprite

      private net.minecraft.client.renderer.texture.TextureAtlasSprite sprite
    • shade

      private boolean shade
    • lightEmission

      private int lightEmission
    • hasAmbientOcclusion

      private boolean hasAmbientOcclusion
  • Constructor Details

    • QuadBakingVertexConsumer

      public QuadBakingVertexConsumer()
  • Method Details

    • addVertex

      public com.mojang.blaze3d.vertex.VertexConsumer addVertex(float x, float y, float z)
      Specified by:
      addVertex in interface com.mojang.blaze3d.vertex.VertexConsumer
    • setNormal

      public com.mojang.blaze3d.vertex.VertexConsumer setNormal(float x, float y, float z)
      Specified by:
      setNormal in interface com.mojang.blaze3d.vertex.VertexConsumer
    • setColor

      public com.mojang.blaze3d.vertex.VertexConsumer setColor(int r, int g, int b, int a)
      Specified by:
      setColor in interface com.mojang.blaze3d.vertex.VertexConsumer
    • setUv

      public com.mojang.blaze3d.vertex.VertexConsumer setUv(float u, float v)
      Specified by:
      setUv in interface com.mojang.blaze3d.vertex.VertexConsumer
    • setUv1

      public com.mojang.blaze3d.vertex.VertexConsumer setUv1(int u, int v)
      Specified by:
      setUv1 in interface com.mojang.blaze3d.vertex.VertexConsumer
    • setUv2

      public com.mojang.blaze3d.vertex.VertexConsumer setUv2(int u, int v)
      Specified by:
      setUv2 in interface com.mojang.blaze3d.vertex.VertexConsumer
    • misc

      public com.mojang.blaze3d.vertex.VertexConsumer misc(com.mojang.blaze3d.vertex.VertexFormatElement element, int... rawData)
      Description copied from interface: IVertexConsumerExtension
      Consumes an unknown VertexFormatElement as a raw int data array.

      If the consumer needs to store the data for later use, it must copy it. There are no guarantees on immutability.

      Specified by:
      misc in interface IVertexConsumerExtension
    • setTintIndex

      public void setTintIndex(int tintIndex)
    • setDirection

      public void setDirection(net.minecraft.core.Direction direction)
    • setSprite

      public void setSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
    • setShade

      public void setShade(boolean shade)
    • setLightEmission

      public void setLightEmission(int lightEmission)
    • setHasAmbientOcclusion

      public void setHasAmbientOcclusion(boolean hasAmbientOcclusion)
    • bakeQuad

      public net.minecraft.client.renderer.block.model.BakedQuad bakeQuad()