Class BufferBuilder

java.lang.Object
net.minecraft.client.render.BufferBuilder
All Implemented Interfaces:
VertexConsumer

@Environment(CLIENT) public class BufferBuilder extends Object implements VertexConsumer
Builds a buffer of primitives and optionally sorts them by the distance from the camera.

This builder can sort quad primitives. It sorts them by the distance between the camera position and the center of the quad. Sorting is required when drawing translucent objects because they have to be drawn in back-to-front order. See Transparency Sorting - OpenGL Wiki.

For LINES and LINE_STRIP draw modes, this builder duplicates every vertex in a line to produce a quad with zero area. See GameRenderer.getRenderTypeLinesProgram().

Mappings:
Namespace Name
named net/minecraft/client/render/BufferBuilder
intermediary net/minecraft/class_287
official fax
  • Field Details

    • field_52068

      private static final long field_52068
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_52068 Lnet/minecraft/client/render/BufferBuilder;field_52068:J
      intermediary field_52068 Lnet/minecraft/class_287;field_52068:J
      official a Lfax;a:J
    • field_52069

      private static final long field_52069
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_52069 Lnet/minecraft/client/render/BufferBuilder;field_52069:J
      intermediary field_52069 Lnet/minecraft/class_287;field_52069:J
      official b Lfax;b:J
    • field_52070

      private static final boolean field_52070
      Mappings:
      Namespace Name Mixin selector
      named field_52070 Lnet/minecraft/client/render/BufferBuilder;field_52070:Z
      intermediary field_52070 Lnet/minecraft/class_287;field_52070:Z
      official c Lfax;c:Z
    • field_52071

      private final class_9799 field_52071
      Mappings:
      Namespace Name Mixin selector
      named field_52071 Lnet/minecraft/client/render/BufferBuilder;field_52071:Lnet/minecraft/class_9799;
      intermediary field_52071 Lnet/minecraft/class_287;field_52071:Lnet/minecraft/class_9799;
      official d Lfax;d:Lfaz;
    • field_52072

      private long field_52072
      Mappings:
      Namespace Name Mixin selector
      named field_52072 Lnet/minecraft/client/render/BufferBuilder;field_52072:J
      intermediary field_52072 Lnet/minecraft/class_287;field_52072:J
      official e Lfax;e:J
    • vertexCount

      private int vertexCount
      Mappings:
      Namespace Name Mixin selector
      named vertexCount Lnet/minecraft/client/render/BufferBuilder;vertexCount:I
      intermediary field_1554 Lnet/minecraft/class_287;field_1554:I
      official f Lfax;f:I
    • format

      private final VertexFormat format
      Mappings:
      Namespace Name Mixin selector
      named format Lnet/minecraft/client/render/BufferBuilder;format:Lnet/minecraft/client/render/VertexFormat;
      intermediary field_1565 Lnet/minecraft/class_287;field_1565:Lnet/minecraft/class_293;
      official g Lfax;g:Lfbh;
    • field_52073

      private final VertexFormat.DrawMode field_52073
      Mappings:
      Namespace Name Mixin selector
      named field_52073 Lnet/minecraft/client/render/BufferBuilder;field_52073:Lnet/minecraft/client/render/VertexFormat$DrawMode;
      intermediary field_52073 Lnet/minecraft/class_287;field_52073:Lnet/minecraft/class_293$class_5596;
      official h Lfax;h:Lfbh$c;
    • canSkipElementChecks

      private final boolean canSkipElementChecks
      Whether this builder is aware of the vertex format and can skip checks for the current target element while building a vertex in
      invalid reference
      #vertex(float, float, float, float, float, float, float, float, float, int, int, float, float, float)
      .
      Mappings:
      Namespace Name Mixin selector
      named canSkipElementChecks Lnet/minecraft/client/render/BufferBuilder;canSkipElementChecks:Z
      intermediary field_21594 Lnet/minecraft/class_287;field_21594:Z
      official i Lfax;i:Z
    • hasOverlay

      private final boolean hasOverlay
      Mappings:
      Namespace Name Mixin selector
      named hasOverlay Lnet/minecraft/client/render/BufferBuilder;hasOverlay:Z
      intermediary field_21595 Lnet/minecraft/class_287;field_21595:Z
      official j Lfax;j:Z
    • field_52074

      private final int field_52074
      Mappings:
      Namespace Name Mixin selector
      named field_52074 Lnet/minecraft/client/render/BufferBuilder;field_52074:I
      intermediary field_52074 Lnet/minecraft/class_287;field_52074:I
      official k Lfax;k:I
    • field_52075

      private final int field_52075
      Mappings:
      Namespace Name Mixin selector
      named field_52075 Lnet/minecraft/client/render/BufferBuilder;field_52075:I
      intermediary field_52075 Lnet/minecraft/class_287;field_52075:I
      official l Lfax;l:I
    • field_52076

      private final int[] field_52076
      Mappings:
      Namespace Name Mixin selector
      named field_52076 Lnet/minecraft/client/render/BufferBuilder;field_52076:[I
      intermediary field_52076 Lnet/minecraft/class_287;field_52076:[I
      official m Lfax;m:[I
    • field_52077

      private int field_52077
      Mappings:
      Namespace Name Mixin selector
      named field_52077 Lnet/minecraft/client/render/BufferBuilder;field_52077:I
      intermediary field_52077 Lnet/minecraft/class_287;field_52077:I
      official n Lfax;n:I
    • building

      private boolean building
      Mappings:
      Namespace Name Mixin selector
      named building Lnet/minecraft/client/render/BufferBuilder;building:Z
      intermediary field_1556 Lnet/minecraft/class_287;field_1556:Z
      official o Lfax;o:Z
  • Constructor Details

  • Method Details

    • method_60794

      @Nullable public @Nullable class_9801 method_60794()
      Mappings:
      Namespace Name Mixin selector
      named method_60794 Lnet/minecraft/client/render/BufferBuilder;method_60794()Lnet/minecraft/class_9801;
      intermediary method_60794 Lnet/minecraft/class_287;method_60794()Lnet/minecraft/class_9801;
      official a Lfax;a()Lfbb;
    • method_60800

      public class_9801 method_60800()
      Mappings:
      Namespace Name Mixin selector
      named method_60800 Lnet/minecraft/client/render/BufferBuilder;method_60800()Lnet/minecraft/class_9801;
      intermediary method_60800 Lnet/minecraft/class_287;method_60800()Lnet/minecraft/class_9801;
      official b Lfax;b()Lfbb;
    • method_60802

      private void method_60802()
      Mappings:
      Namespace Name Mixin selector
      named method_60802 Lnet/minecraft/client/render/BufferBuilder;method_60802()V
      intermediary method_60802 Lnet/minecraft/class_287;method_60802()V
      official c Lfax;c()V
    • method_60804

      @Nullable private @Nullable class_9801 method_60804()
      Mappings:
      Namespace Name Mixin selector
      named method_60804 Lnet/minecraft/client/render/BufferBuilder;method_60804()Lnet/minecraft/class_9801;
      intermediary method_60804 Lnet/minecraft/class_287;method_60804()Lnet/minecraft/class_9801;
      official d Lfax;d()Lfbb;
    • method_60805

      private long method_60805()
      Mappings:
      Namespace Name Mixin selector
      named method_60805 Lnet/minecraft/client/render/BufferBuilder;method_60805()J
      intermediary method_60805 Lnet/minecraft/class_287;method_60805()J
      official e Lfax;e()J
    • method_60798

      private long method_60798(VertexFormatElement vertexFormatElement)
      Mappings:
      Namespace Name Mixin selector
      named method_60798 Lnet/minecraft/client/render/BufferBuilder;method_60798(Lnet/minecraft/client/render/VertexFormatElement;)J
      intermediary method_60798 Lnet/minecraft/class_287;method_60798(Lnet/minecraft/class_296;)J
      official a Lfax;a(Lfbi;)J
    • method_60806

      private void method_60806()
      Mappings:
      Namespace Name Mixin selector
      named method_60806 Lnet/minecraft/client/render/BufferBuilder;method_60806()V
      intermediary method_60806 Lnet/minecraft/class_287;method_60806()V
      official f Lfax;f()V
    • method_60797

      private static void method_60797(long long2, int int2)
      Mappings:
      Namespace Name Mixin selector
      named method_60797 Lnet/minecraft/client/render/BufferBuilder;method_60797(JI)V
      intermediary method_60797 Lnet/minecraft/class_287;method_60797(JI)V
      official a Lfax;a(JI)V
    • method_60801

      private static void method_60801(long long2, int int2)
      Mappings:
      Namespace Name Mixin selector
      named method_60801 Lnet/minecraft/client/render/BufferBuilder;method_60801(JI)V
      intermediary method_60801 Lnet/minecraft/class_287;method_60801(JI)V
      official b Lfax;b(JI)V
    • vertex

      public VertexConsumer vertex(float float2, float float3, float float4)
      Specifies the
      invalid reference
      position element
      of the current vertex.

      This is typically the first element in a vertex, hence the name.

      Specified by:
      vertex in interface VertexConsumer
      Returns:
      this consumer, for chaining
      Throws:
      IllegalStateException - if this consumer is not currently accepting a position element.
      Mappings:
      Namespace Name Mixin selector
      named vertex Lnet/minecraft/client/render/VertexConsumer;vertex(FFF)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_22912 Lnet/minecraft/class_4588;method_22912(FFF)Lnet/minecraft/class_4588;
      official a Lfbg;a(FFF)Lfbg;
    • color

      public VertexConsumer color(int red, int green, int blue, int alpha)
      Specifies the
      invalid reference
      color element
      of the current vertex.
      Specified by:
      color in interface VertexConsumer
      Returns:
      this consumer, for chaining
      Throws:
      IllegalStateException - if this consumer is not currently accepting a color element or if a color has been set in
      invalid reference
      #fixedColor
      .
      Mappings:
      Namespace Name Mixin selector
      named color Lnet/minecraft/client/render/VertexConsumer;color(IIII)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_1336 Lnet/minecraft/class_4588;method_1336(IIII)Lnet/minecraft/class_4588;
      official a Lfbg;a(IIII)Lfbg;
    • color

      public VertexConsumer color(int argb)
      Specifies the
      invalid reference
      color element
      of the current vertex.
      Specified by:
      color in interface VertexConsumer
      Returns:
      this consumer, for chaining
      Throws:
      IllegalStateException - if this consumer is not currently accepting a color element or if a color has been set in
      invalid reference
      #fixedColor
      .
      Mappings:
      Namespace Name Mixin selector
      named color Lnet/minecraft/client/render/VertexConsumer;color(I)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_39415 Lnet/minecraft/class_4588;method_39415(I)Lnet/minecraft/class_4588;
      official a Lfbg;a(I)Lfbg;
    • texture

      public VertexConsumer texture(float u, float v)
      Specifies the
      invalid reference
      texture element
      of the current vertex.
      Specified by:
      texture in interface VertexConsumer
      Returns:
      this consumer, for chaining
      Throws:
      IllegalStateException - if this consumer is not currently accepting a texture element.
      Mappings:
      Namespace Name Mixin selector
      named texture Lnet/minecraft/client/render/VertexConsumer;texture(FF)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_22913 Lnet/minecraft/class_4588;method_22913(FF)Lnet/minecraft/class_4588;
      official a Lfbg;a(FF)Lfbg;
    • method_60796

      public VertexConsumer method_60796(int int2, int int3)
      Specified by:
      method_60796 in interface VertexConsumer
      Mappings:
      Namespace Name Mixin selector
      named method_60796 Lnet/minecraft/client/render/VertexConsumer;method_60796(II)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_60796 Lnet/minecraft/class_4588;method_60796(II)Lnet/minecraft/class_4588;
      official a Lfbg;a(II)Lfbg;
    • overlay

      public VertexConsumer overlay(int uv)
      Specifies the
      invalid reference
      overlay element
      of the current vertex.
      Specified by:
      overlay in interface VertexConsumer
      Returns:
      this consumer, for chaining
      Throws:
      IllegalStateException - if this consumer is not currently accepting an overlay element.
      Mappings:
      Namespace Name Mixin selector
      named overlay Lnet/minecraft/client/render/VertexConsumer;overlay(I)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_22922 Lnet/minecraft/class_4588;method_22922(I)Lnet/minecraft/class_4588;
      official b Lfbg;b(I)Lfbg;
    • light

      public VertexConsumer light(int u, int v)
      Specifies the
      invalid reference
      light element
      of the current vertex.
      Specified by:
      light in interface VertexConsumer
      Returns:
      this consumer, for chaining
      Throws:
      IllegalStateException - if this consumer is not currently accepting a light element.
      Mappings:
      Namespace Name Mixin selector
      named light Lnet/minecraft/client/render/VertexConsumer;light(II)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_22921 Lnet/minecraft/class_4588;method_22921(II)Lnet/minecraft/class_4588;
      official b Lfbg;b(II)Lfbg;
    • method_60803

      public VertexConsumer method_60803(int int2)
      Specified by:
      method_60803 in interface VertexConsumer
      Mappings:
      Namespace Name Mixin selector
      named method_60803 Lnet/minecraft/client/render/VertexConsumer;method_60803(I)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_60803 Lnet/minecraft/class_4588;method_60803(I)Lnet/minecraft/class_4588;
      official c Lfbg;c(I)Lfbg;
    • method_60799

      private VertexConsumer method_60799(short short2, short short3, VertexFormatElement vertexFormatElement)
      Mappings:
      Namespace Name Mixin selector
      named method_60799 Lnet/minecraft/client/render/BufferBuilder;method_60799(SSLnet/minecraft/client/render/VertexFormatElement;)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_60799 Lnet/minecraft/class_287;method_60799(SSLnet/minecraft/class_296;)Lnet/minecraft/class_4588;
      official a Lfax;a(SSLfbi;)Lfbg;
    • normal

      public VertexConsumer normal(float x, float y, float z)
      Specifies the
      invalid reference
      normal element
      of the current vertex.
      Specified by:
      normal in interface VertexConsumer
      Returns:
      this consumer, for chaining
      Throws:
      IllegalStateException - if this consumer is not currently accepting a normal element.
      Mappings:
      Namespace Name Mixin selector
      named normal Lnet/minecraft/client/render/VertexConsumer;normal(FFF)Lnet/minecraft/client/render/VertexConsumer;
      intermediary method_22914 Lnet/minecraft/class_4588;method_22914(FFF)Lnet/minecraft/class_4588;
      official b Lfbg;b(FFF)Lfbg;
    • method_60795

      private static byte method_60795(float float2)
      Mappings:
      Namespace Name Mixin selector
      named method_60795 Lnet/minecraft/client/render/BufferBuilder;method_60795(F)B
      intermediary method_60795 Lnet/minecraft/class_287;method_60795(F)B
      official a Lfax;a(F)B
    • vertex

      public void vertex(float x, float y, float z, int int2, float green, float blue, int int3, int int4, float v, float float2, float float3)
      Specifies the
      invalid reference
      position
      ,
      invalid reference
      color
      ,
      invalid reference
      texture
      ,
      invalid reference
      overlay
      ,
      invalid reference
      light
      , and
      invalid reference
      normal
      elements of the current vertex and starts consuming the next vertex.
      Specified by:
      vertex in interface VertexConsumer
      Throws:
      IllegalStateException - if a color has been set in
      invalid reference
      #fixedColor
      .
      Mappings:
      Namespace Name Mixin selector
      named vertex Lnet/minecraft/client/render/VertexConsumer;vertex(FFFIFFIIFFF)V
      intermediary method_23919 Lnet/minecraft/class_4588;method_23919(FFFIFFIIFFF)V
      official a Lfbg;a(FFFIFFIIFFF)V