Class BufferBuilder

java.lang.Object
com.mojang.blaze3d.vertex.BufferBuilder
All Implemented Interfaces:
VertexConsumer, IVertexConsumerExtension

public class BufferBuilder extends Object implements VertexConsumer
  • Field Details

    • NOT_BUILDING

      private static final long NOT_BUILDING
      See Also:
    • UNKNOWN_ELEMENT

      private static final long UNKNOWN_ELEMENT
      See Also:
    • IS_LITTLE_ENDIAN

      private static final boolean IS_LITTLE_ENDIAN
    • buffer

      private final ByteBufferBuilder buffer
    • vertexPointer

      private long vertexPointer
    • vertices

      private int vertices
    • format

      private final VertexFormat format
    • mode

      private final VertexFormat.Mode mode
    • fastFormat

      private final boolean fastFormat
    • fullFormat

      private final boolean fullFormat
    • vertexSize

      private final int vertexSize
    • initialElementsToFill

      private final int initialElementsToFill
    • offsetsByElement

      private final int[] offsetsByElement
    • elementsToFill

      private int elementsToFill
    • building

      private boolean building
  • Constructor Details

  • Method Details

    • build

      @Nullable public MeshData build()
    • buildOrThrow

      public MeshData buildOrThrow()
    • ensureBuilding

      private void ensureBuilding()
    • storeMesh

      @Nullable private MeshData storeMesh()
    • beginVertex

      private long beginVertex()
    • beginElement

      private long beginElement(VertexFormatElement p_350425_)
    • endLastVertex

      private void endLastVertex()
    • putRgba

      private static void putRgba(long p_350739_, int p_350474_)
    • putPackedUv

      private static void putPackedUv(long p_350878_, int p_350667_)
    • addVertex

      public VertexConsumer addVertex(float p_350828_, float p_350614_, float p_350700_)
      Specified by:
      addVertex in interface VertexConsumer
    • setColor

      public VertexConsumer setColor(int p_350581_, int p_350952_, int p_350275_, int p_350985_)
      Specified by:
      setColor in interface VertexConsumer
    • setColor

      public VertexConsumer setColor(int p_350530_)
      Specified by:
      setColor in interface VertexConsumer
    • setUv

      public VertexConsumer setUv(float p_350574_, float p_350773_)
      Specified by:
      setUv in interface VertexConsumer
    • setUv1

      public VertexConsumer setUv1(int p_350396_, int p_350722_)
      Specified by:
      setUv1 in interface VertexConsumer
    • setOverlay

      public VertexConsumer setOverlay(int p_350297_)
      Specified by:
      setOverlay in interface VertexConsumer
    • setUv2

      public VertexConsumer setUv2(int p_351058_, int p_350320_)
      Specified by:
      setUv2 in interface VertexConsumer
    • setLight

      public VertexConsumer setLight(int p_350848_)
      Specified by:
      setLight in interface VertexConsumer
    • uvShort

      private VertexConsumer uvShort(short p_350449_, short p_350780_, VertexFormatElement p_350925_)
    • setNormal

      public VertexConsumer setNormal(float p_351000_, float p_350982_, float p_350974_)
      Specified by:
      setNormal in interface VertexConsumer
    • normalIntValue

      private static byte normalIntValue(float p_350741_)
    • addVertex

      public void addVertex(float p_350423_, float p_350381_, float p_350383_, int p_350371_, float p_350977_, float p_350674_, int p_350816_, int p_350690_, float p_350640_, float p_350490_, float p_350810_)
      Specified by:
      addVertex in interface VertexConsumer