Class BufferBuilder

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

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_343872_)
    • endLastVertex

      private void endLastVertex()
    • putRgba

      private static void putRgba(long p_344481_, int p_342528_)
    • putPackedUv

      private static void putPackedUv(long p_344069_, int p_342894_)
    • addVertex

      public VertexConsumer addVertex(float p_342038_, float p_342902_, float p_344845_)
      Specified by:
      addVertex in interface VertexConsumer
    • setColor

      public VertexConsumer setColor(int p_345246_, int p_343163_, int p_342676_, int p_345202_)
      Specified by:
      setColor in interface VertexConsumer
    • setColor

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

      public VertexConsumer setUv(float p_344538_, float p_343862_)
      Specified by:
      setUv in interface VertexConsumer
    • setUv1

      public VertexConsumer setUv1(int p_345138_, int p_344474_)
      Specified by:
      setUv1 in interface VertexConsumer
    • setOverlay

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

      public VertexConsumer setUv2(int p_343260_, int p_345129_)
      Specified by:
      setUv2 in interface VertexConsumer
    • setLight

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

      private VertexConsumer uvShort(short p_342039_, short p_345222_, VertexFormatElement p_344482_)
    • setNormal

      public VertexConsumer setNormal(float p_342317_, float p_342276_, float p_342607_)
      Specified by:
      setNormal in interface VertexConsumer
    • normalIntValue

      private static byte normalIntValue(float p_344123_)
    • addVertex

      public void addVertex(float p_343280_, float p_344969_, float p_343237_, int p_342708_, float p_345023_, float p_344850_, int p_344316_, int p_342457_, float p_344002_, float p_344052_, float p_343783_)
      Specified by:
      addVertex in interface VertexConsumer