Package net.minecraft.client.render
Class BufferBuilder
java.lang.Object
net.minecraft.client.render.BufferBuilder
- All Implemented Interfaces:
- 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
 
.invalid reference
GameRenderer#getRenderTypeLinesProgram
- Mappings:
- Namespace - Name - named - net/minecraft/client/render/BufferBuilder- intermediary - net/minecraft/class_287- official - ffq
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final BufferAllocatorprivate booleanprivate final booleanWhether 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)private intprivate final VertexFormat.DrawModeprivate static final longprivate static final longprivate final VertexFormatprivate final booleanprivate static final booleanprivate final int[]private final intprivate intprivate longprivate final int
- 
Constructor SummaryConstructorsConstructorDescriptionBufferBuilder(BufferAllocator allocator, VertexFormat.DrawMode drawMode, VertexFormat format) 
- 
Method SummaryModifier and TypeMethodDescriptionprivate longbeginElement(VertexFormatElement element) private longprivate @Nullable BuiltBufferbuild()color(int argb) Specifies theof the current vertex.invalid referencecolor element color(int red, int green, int blue, int alpha) Specifies theof the current vertex.invalid referencecolor element end()private voidprivate voidprivate static bytefloatToByte(float f) light(int uv) Specifies theof the current vertex.invalid referencelight element light(int u, int v) Specifies theof the current vertex.invalid referencelight element normal(float x, float y, float z) Specifies theof the current vertex.invalid referencenormal element overlay(int uv) Specifies theof the current vertex.invalid referenceoverlay element overlay(int u, int v) Specifies theof the current vertex.invalid referenceoverlay element private static voidputColor(long pointer, int argb) private static voidputInt(long pointer, int i) private VertexConsumerputUv(short u, short v, VertexFormatElement element) texture(float u, float v) Specifies theof the current vertex.invalid referencetexture element vertex(float x, float y, float z) Specifies theof the current vertex.invalid referenceposition element voidvertex(float x, float y, float z, int color, float u, float v, int overlay, int light, float normalX, float normalY, float normalZ) Specifies the,invalid referenceposition ,invalid referencecolor ,invalid referencetexture ,invalid referenceoverlay , andinvalid referencelight elements of the current vertex and starts consuming the next vertex.invalid referencenormal 
- 
Field Details- 
field_52068private 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- Lffq;a:J
 
- 
field_52069private 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- Lffq;b:J
 
- 
LITTLE_ENDIANprivate static final boolean LITTLE_ENDIAN- Mappings:
- Namespace - Name - Mixin selector - named - LITTLE_ENDIAN- Lnet/minecraft/client/render/BufferBuilder;LITTLE_ENDIAN:Z- intermediary - field_52070- Lnet/minecraft/class_287;field_52070:Z- official - c- Lffq;c:Z
 
- 
allocator- Mappings:
- Namespace - Name - Mixin selector - named - allocator- Lnet/minecraft/client/render/BufferBuilder;allocator:Lnet/minecraft/client/util/BufferAllocator;- intermediary - field_52071- Lnet/minecraft/class_287;field_52071:Lnet/minecraft/class_9799;- official - d- Lffq;d:Lffs;
 
- 
vertexPointerprivate long vertexPointer- Mappings:
- Namespace - Name - Mixin selector - named - vertexPointer- Lnet/minecraft/client/render/BufferBuilder;vertexPointer:J- intermediary - field_52072- Lnet/minecraft/class_287;field_52072:J- official - e- Lffq;e:J
 
- 
vertexCountprivate 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- Lffq;f:I
 
- 
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- Lffq;g:Lfga;
 
- 
drawMode- Mappings:
- Namespace - Name - Mixin selector - named - drawMode- Lnet/minecraft/client/render/BufferBuilder;drawMode:Lnet/minecraft/client/render/VertexFormat$DrawMode;- intermediary - field_52073- Lnet/minecraft/class_287;field_52073:Lnet/minecraft/class_293$class_5596;- official - h- Lffq;h:Lfga$c;
 
- 
canSkipElementChecksprivate final boolean canSkipElementChecksWhether 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- Lffq;i:Z
 
- 
hasOverlayprivate 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- Lffq;j:Z
 
- 
vertexSizeByteprivate final int vertexSizeByte- Mappings:
- Namespace - Name - Mixin selector - named - vertexSizeByte- Lnet/minecraft/client/render/BufferBuilder;vertexSizeByte:I- intermediary - field_52074- Lnet/minecraft/class_287;field_52074:I- official - k- Lffq;k:I
 
- 
requiredMaskprivate final int requiredMask- Mappings:
- Namespace - Name - Mixin selector - named - requiredMask- Lnet/minecraft/client/render/BufferBuilder;requiredMask:I- intermediary - field_52075- Lnet/minecraft/class_287;field_52075:I- official - l- Lffq;l:I
 
- 
offsetsByElementIdprivate final int[] offsetsByElementId- Mappings:
- Namespace - Name - Mixin selector - named - offsetsByElementId- Lnet/minecraft/client/render/BufferBuilder;offsetsByElementId:[I- intermediary - field_52076- Lnet/minecraft/class_287;field_52076:[I- official - m- Lffq;m:[I
 
- 
currentMaskprivate int currentMask- Mappings:
- Namespace - Name - Mixin selector - named - currentMask- Lnet/minecraft/client/render/BufferBuilder;currentMask:I- intermediary - field_52077- Lnet/minecraft/class_287;field_52077:I- official - n- Lffq;n:I
 
- 
buildingprivate 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- Lffq;o:Z
 
 
- 
- 
Constructor Details- 
BufferBuilderpublic BufferBuilder(BufferAllocator allocator, VertexFormat.DrawMode drawMode, VertexFormat format) - Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/client/render/BufferBuilder;<init>(Lnet/minecraft/client/util/BufferAllocator;Lnet/minecraft/client/render/VertexFormat$DrawMode;Lnet/minecraft/client/render/VertexFormat;)V- intermediary - <init>- Lnet/minecraft/class_287;<init>(Lnet/minecraft/class_9799;Lnet/minecraft/class_293$class_5596;Lnet/minecraft/class_293;)V- official - <init>- Lffq;<init>(Lffs;Lfga$c;Lfga;)V
 
 
- 
- 
Method Details- 
endNullable- Mappings:
- Namespace - Name - Mixin selector - named - endNullable- Lnet/minecraft/client/render/BufferBuilder;endNullable()Lnet/minecraft/client/render/BuiltBuffer;- intermediary - method_60794- Lnet/minecraft/class_287;method_60794()Lnet/minecraft/class_9801;- official - a- Lffq;a()Lffu;
 
- 
end- Mappings:
- Namespace - Name - Mixin selector - named - end- Lnet/minecraft/client/render/BufferBuilder;end()Lnet/minecraft/client/render/BuiltBuffer;- intermediary - method_60800- Lnet/minecraft/class_287;method_60800()Lnet/minecraft/class_9801;- official - b- Lffq;b()Lffu;
 
- 
ensureBuildingprivate void ensureBuilding()- Mappings:
- Namespace - Name - Mixin selector - named - ensureBuilding- Lnet/minecraft/client/render/BufferBuilder;ensureBuilding()V- intermediary - method_60802- Lnet/minecraft/class_287;method_60802()V- official - c- Lffq;c()V
 
- 
build- Mappings:
- Namespace - Name - Mixin selector - named - build- Lnet/minecraft/client/render/BufferBuilder;build()Lnet/minecraft/client/render/BuiltBuffer;- intermediary - method_60804- Lnet/minecraft/class_287;method_60804()Lnet/minecraft/class_9801;- official - d- Lffq;d()Lffu;
 
- 
beginVertexprivate long beginVertex()- Mappings:
- Namespace - Name - Mixin selector - named - beginVertex- Lnet/minecraft/client/render/BufferBuilder;beginVertex()J- intermediary - method_60805- Lnet/minecraft/class_287;method_60805()J- official - e- Lffq;e()J
 
- 
beginElement- Mappings:
- Namespace - Name - Mixin selector - named - beginElement- Lnet/minecraft/client/render/BufferBuilder;beginElement(Lnet/minecraft/client/render/VertexFormatElement;)J- intermediary - method_60798- Lnet/minecraft/class_287;method_60798(Lnet/minecraft/class_296;)J- official - a- Lffq;a(Lfgb;)J
 
- 
endVertexprivate void endVertex()- Mappings:
- Namespace - Name - Mixin selector - named - endVertex- Lnet/minecraft/client/render/BufferBuilder;endVertex()V- intermediary - method_60806- Lnet/minecraft/class_287;method_60806()V- official - f- Lffq;f()V
 
- 
putColorprivate static void putColor(long pointer, int argb) - Mappings:
- Namespace - Name - Mixin selector - named - putColor- Lnet/minecraft/client/render/BufferBuilder;putColor(JI)V- intermediary - method_60797- Lnet/minecraft/class_287;method_60797(JI)V- official - a- Lffq;a(JI)V
 
- 
putIntprivate static void putInt(long pointer, int i) - Mappings:
- Namespace - Name - Mixin selector - named - putInt- Lnet/minecraft/client/render/BufferBuilder;putInt(JI)V- intermediary - method_60801- Lnet/minecraft/class_287;method_60801(JI)V- official - b- Lffq;b(JI)V
 
- 
vertexSpecifies theof the current vertex.invalid referenceposition element This is typically the first element in a vertex, hence the name. - Specified by:
- vertexin 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- Lffz;a(FFF)Lffz;
 
- 
colorSpecifies theof the current vertex.invalid referencecolor element - Specified by:
- colorin 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- Lffz;a(IIII)Lffz;
 
- 
colorSpecifies theof the current vertex.invalid referencecolor element - Specified by:
- colorin 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- Lffz;a(I)Lffz;
 
- 
textureSpecifies theof the current vertex.invalid referencetexture element - Specified by:
- texturein 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- Lffz;a(FF)Lffz;
 
- 
overlaySpecifies theof the current vertex.invalid referenceoverlay element - Specified by:
- overlayin 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(II)Lnet/minecraft/client/render/VertexConsumer;- intermediary - method_60796- Lnet/minecraft/class_4588;method_60796(II)Lnet/minecraft/class_4588;- official - a- Lffz;a(II)Lffz;
 
- 
overlaySpecifies theof the current vertex.invalid referenceoverlay element - Specified by:
- overlayin 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- Lffz;b(I)Lffz;
 
- 
lightSpecifies theof the current vertex.invalid referencelight element - Specified by:
- lightin 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- Lffz;b(II)Lffz;
 
- 
lightSpecifies theof the current vertex.invalid referencelight element - Specified by:
- lightin 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(I)Lnet/minecraft/client/render/VertexConsumer;- intermediary - method_60803- Lnet/minecraft/class_4588;method_60803(I)Lnet/minecraft/class_4588;- official - c- Lffz;c(I)Lffz;
 
- 
putUv- Mappings:
- Namespace - Name - Mixin selector - named - putUv- Lnet/minecraft/client/render/BufferBuilder;putUv(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- Lffq;a(SSLfgb;)Lffz;
 
- 
normalSpecifies theof the current vertex.invalid referencenormal element - Specified by:
- normalin 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- Lffz;b(FFF)Lffz;
 
- 
floatToByteprivate static byte floatToByte(float f) - Mappings:
- Namespace - Name - Mixin selector - named - floatToByte- Lnet/minecraft/client/render/BufferBuilder;floatToByte(F)B- intermediary - method_60795- Lnet/minecraft/class_287;method_60795(F)B- official - a- Lffq;a(F)B
 
- 
vertexpublic void vertex(float x, float y, float z, int color, float u, float v, int overlay, int light, float normalX, float normalY, float normalZ) Specifies the,invalid referenceposition ,invalid referencecolor ,invalid referencetexture ,invalid referenceoverlay , andinvalid referencelight elements of the current vertex and starts consuming the next vertex.invalid referencenormal - Specified by:
- vertexin 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- Lffz;a(FFFIFFIIFFF)V
 
 
-