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
GameRenderer.getRenderTypeLinesProgram()
.
- Mappings:
Namespace Name named net/minecraft/client/render/BufferBuilder
intermediary net/minecraft/class_287
official fbd
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BufferAllocator
private boolean
private final boolean
Whether this builder is aware of the vertex format and can skip checks for the current target element while building a vertex ininvalid reference
#vertex(float, float, float, float, float, float, float, float, float, int, int, float, float, float)
private int
private final VertexFormat.DrawMode
private static final long
private static final long
private final VertexFormat
private final boolean
private static final boolean
private final int[]
private final int
private int
private long
private final int
-
Constructor Summary
ConstructorDescriptionBufferBuilder
(BufferAllocator allocator, VertexFormat.DrawMode drawMode, VertexFormat format) -
Method Summary
Modifier and TypeMethodDescriptionprivate long
beginElement
(VertexFormatElement element) private long
private @Nullable BuiltBuffer
build()
color
(int argb) Specifies theinvalid reference
color element
color
(int red, int green, int blue, int alpha) Specifies theinvalid reference
color element
end()
private void
private void
private static byte
floatToByte
(float f) light
(int uv) Specifies theinvalid reference
light element
light
(int u, int v) Specifies theinvalid reference
light element
normal
(float x, float y, float z) Specifies theinvalid reference
normal element
overlay
(int uv) Specifies theinvalid reference
overlay element
overlay
(int u, int v) Specifies theinvalid reference
overlay element
private static void
putColor
(long pointer, int argb) private static void
putInt
(long pointer, int i) private VertexConsumer
putUv
(short u, short v, VertexFormatElement element) texture
(float u, float v) Specifies theinvalid reference
texture element
vertex
(float x, float y, float z) Specifies theinvalid reference
position element
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 theinvalid reference
position
invalid reference
color
invalid reference
texture
invalid reference
overlay
invalid reference
light
invalid reference
normal
-
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
Lfbd;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
Lfbd;b:J
-
LITTLE_ENDIAN
private 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
Lfbd;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
Lfbd;d:Lfbf;
-
vertexPointer
private 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
Lfbd;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
Lfbd;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
Lfbd;g:Lfbn;
-
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
Lfbd;h:Lfbn$c;
-
canSkipElementChecks
private final boolean canSkipElementChecksWhether this builder is aware of the vertex format and can skip checks for the current target element while building a vertex ininvalid 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
Lfbd;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
Lfbd;j:Z
-
vertexSizeByte
private 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
Lfbd;k:I
-
requiredMask
private 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
Lfbd;l:I
-
offsetsByElementId
private 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
Lfbd;m:[I
-
currentMask
private 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
Lfbd;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
Lfbd;o:Z
-
-
Constructor Details
-
BufferBuilder
public 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>
Lfbd;<init>(Lfbf;Lfbn$c;Lfbn;)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
Lfbd;a()Lfbh;
-
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
Lfbd;b()Lfbh;
-
ensureBuilding
private 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
Lfbd;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
Lfbd;d()Lfbh;
-
beginVertex
private 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
Lfbd;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
Lfbd;a(Lfbo;)J
-
endVertex
private 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
Lfbd;f()V
-
putColor
private 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
Lfbd;a(JI)V
-
putInt
private 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
Lfbd;b(JI)V
-
vertex
Specifies theinvalid reference
position element
This is typically the first element in a vertex, hence the name.
- Specified by:
vertex
in interfaceVertexConsumer
- 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
Lfbm;a(FFF)Lfbm;
-
color
Specifies theinvalid reference
color element
- Specified by:
color
in interfaceVertexConsumer
- Returns:
- this consumer, for chaining
- Throws:
IllegalStateException
- if this consumer is not currently accepting a color element or if a color has been set ininvalid 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
Lfbm;a(IIII)Lfbm;
-
color
Specifies theinvalid reference
color element
- Specified by:
color
in interfaceVertexConsumer
- Returns:
- this consumer, for chaining
- Throws:
IllegalStateException
- if this consumer is not currently accepting a color element or if a color has been set ininvalid 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
Lfbm;a(I)Lfbm;
-
texture
Specifies theinvalid reference
texture element
- Specified by:
texture
in interfaceVertexConsumer
- 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
Lfbm;a(FF)Lfbm;
-
overlay
Specifies theinvalid reference
overlay element
- Specified by:
overlay
in interfaceVertexConsumer
- 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
Lfbm;a(II)Lfbm;
-
overlay
Specifies theinvalid reference
overlay element
- Specified by:
overlay
in interfaceVertexConsumer
- 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
Lfbm;b(I)Lfbm;
-
light
Specifies theinvalid reference
light element
- Specified by:
light
in interfaceVertexConsumer
- 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
Lfbm;b(II)Lfbm;
-
light
Specifies theinvalid reference
light element
- Specified by:
light
in interfaceVertexConsumer
- 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
Lfbm;c(I)Lfbm;
-
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
Lfbd;a(SSLfbo;)Lfbm;
-
normal
Specifies theinvalid reference
normal element
- Specified by:
normal
in interfaceVertexConsumer
- 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
Lfbm;b(FFF)Lfbm;
-
floatToByte
private 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
Lfbd;a(F)B
-
vertex
public 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 theinvalid reference
position
invalid reference
color
invalid reference
texture
invalid reference
overlay
invalid reference
light
invalid reference
normal
- Specified by:
vertex
in interfaceVertexConsumer
- Throws:
IllegalStateException
- if a color has been set ininvalid 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
Lfbm;a(FFFIFFIIFFF)V
-