Class BufferBuilder

All Implemented Interfaces:
BufferVertexConsumer, VertexConsumer

@Environment(CLIENT)
public class BufferBuilder
extends FixedColorVertexConsumer
implements BufferVertexConsumer
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • buffer

      private ByteBuffer buffer
    • parameters

      private final List<BufferBuilder.DrawArrayParameters> parameters
    • lastParameterIndex

      private int lastParameterIndex
    • buildStart

      private int buildStart
    • elementOffset

      private int elementOffset
    • nextDrawStart

      private int nextDrawStart
    • vertexCount

      private int vertexCount
    • currentElement

      @Nullable private VertexFormatElement currentElement
    • currentElementId

      private int currentElementId
    • drawMode

      private int drawMode
    • format

      private VertexFormat format
    • field_21594

      private boolean field_21594
    • field_21595

      private boolean field_21595
    • building

      private boolean building
  • Constructor Details

    • BufferBuilder

      public BufferBuilder​(int initialCapacity)
  • Method Details

    • grow

      protected void grow()
    • grow

      private void grow​(int size)
    • roundBufferSize

      private static int roundBufferSize​(int amount)
    • sortQuads

      public void sortQuads​(float cameraX, float cameraY, float cameraZ)
    • method_22628

      private void method_22628​(FloatBuffer floatBuffer, int int2)
    • popState

      public BufferBuilder.State popState()
    • getDistanceSq

      private static float getDistanceSq​(FloatBuffer buffer, float x, float y, float z, int int2, int int3)
    • restoreState

      public void restoreState​(BufferBuilder.State state)
    • begin

      public void begin​(int drawMode, VertexFormat format)
    • method_23918

      private void method_23918​(VertexFormat vertexFormat)
    • end

      public void end()
    • putByte

      public void putByte​(int index, byte value)
      Specified by:
      putByte in interface BufferVertexConsumer
    • putShort

      public void putShort​(int index, short value)
      Specified by:
      putShort in interface BufferVertexConsumer
    • putFloat

      public void putFloat​(int index, float value)
      Specified by:
      putFloat in interface BufferVertexConsumer
    • next

      public void next()
      Specified by:
      next in interface VertexConsumer
    • nextElement

      public void nextElement()
      Specified by:
      nextElement in interface BufferVertexConsumer
    • color

      public VertexConsumer color​(int red, int green, int blue, int alpha)
      Specified by:
      color in interface BufferVertexConsumer
      Specified by:
      color in interface VertexConsumer
    • vertex

      public void vertex​(float x, float y, float z, float red, float green, float blue, float alpha, float u, float v, int overlay, int light, float normalX, float normalY, float normalZ)
      Specified by:
      vertex in interface VertexConsumer
    • popData

      public com.mojang.datafixers.util.Pair<BufferBuilder.DrawArrayParameters,​ByteBuffer> popData()
    • clear

      public void clear()
    • reset

      public void reset()
    • getCurrentElement

      public VertexFormatElement getCurrentElement()
      Specified by:
      getCurrentElement in interface BufferVertexConsumer
    • isBuilding

      public boolean isBuilding()