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
RenderLayer.getLines().
- Mappings:
Namespace Name named net/minecraft/client/render/BufferBuilderintermediary net/minecraft/class_287official fkz
-
Field Summary
FieldsModifier 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 booleanprivate static final booleanprivate final int[]private final intprivate intprivate final VertexFormatprivate longprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionBufferBuilder(BufferAllocator allocator, VertexFormat.DrawMode drawMode, VertexFormat vertexFormat) -
Method Summary
Modifier and TypeMethodDescriptionprivate longbeginElement(VertexFormatElement element) private longprivate @Nullable BuiltBufferbuild()color(int argb) Specifies theof the current vertex.invalid reference
color element
color(int red, int green, int blue, int alpha) Specifies theof the current vertex.invalid reference
color element
end()private voidprivate voidprivate static bytefloatToByte(float f) light(int uv) Specifies theof the current vertex.invalid reference
light element
light(int u, int v) Specifies theof the current vertex.invalid reference
light element
normal(float x, float y, float z) Specifies theof the current vertex.invalid reference
normal element
overlay(int uv) Specifies theof the current vertex.invalid reference
overlay element
overlay(int u, int v) Specifies theof the current vertex.invalid reference
overlay element
private static voidputColor(long pointer, int argb) private static voidputInt(long pointer, int i) texture(float u, float v) Specifies theof the current vertex.invalid reference
texture element
private VertexConsumeruv(short u, short v, VertexFormatElement element) vertex(float x, float y, float z) Specifies theof the current vertex.invalid reference
position 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 reference
position
,invalid reference
color
,invalid reference
texture
,invalid reference
overlay
, andinvalid reference
light
elements of the current vertex and starts consuming the next vertex.invalid reference
normal
-
Field Details
-
field_52068
private static final long field_52068- See Also:
- Mappings:
Namespace Name Mixin selector named field_52068Lnet/minecraft/client/render/BufferBuilder;field_52068:Jintermediary field_52068Lnet/minecraft/class_287;field_52068:Jofficial aLfkz;a:J
-
field_52069
private static final long field_52069- See Also:
- Mappings:
Namespace Name Mixin selector named field_52069Lnet/minecraft/client/render/BufferBuilder;field_52069:Jintermediary field_52069Lnet/minecraft/class_287;field_52069:Jofficial bLfkz;b:J
-
LITTLE_ENDIAN
private static final boolean LITTLE_ENDIAN- Mappings:
Namespace Name Mixin selector named LITTLE_ENDIANLnet/minecraft/client/render/BufferBuilder;LITTLE_ENDIAN:Zintermediary field_52070Lnet/minecraft/class_287;field_52070:Zofficial cLfkz;c:Z
-
allocator
- Mappings:
Namespace Name Mixin selector named allocatorLnet/minecraft/client/render/BufferBuilder;allocator:Lnet/minecraft/client/util/BufferAllocator;intermediary field_52071Lnet/minecraft/class_287;field_52071:Lnet/minecraft/class_9799;official dLfkz;d:Lfla;
-
vertexPointer
private long vertexPointer- Mappings:
Namespace Name Mixin selector named vertexPointerLnet/minecraft/client/render/BufferBuilder;vertexPointer:Jintermediary field_52072Lnet/minecraft/class_287;field_52072:Jofficial eLfkz;e:J
-
vertexCount
private int vertexCount- Mappings:
Namespace Name Mixin selector named vertexCountLnet/minecraft/client/render/BufferBuilder;vertexCount:Iintermediary field_1554Lnet/minecraft/class_287;field_1554:Iofficial fLfkz;f:I
-
vertexFormat
- Mappings:
Namespace Name Mixin selector named vertexFormatLnet/minecraft/client/render/BufferBuilder;vertexFormat:Lcom/mojang/blaze3d/vertex/VertexFormat;intermediary field_1565Lnet/minecraft/class_287;field_1565:Lcom/mojang/blaze3d/vertex/VertexFormat;official gLfkz;g:Lcom/mojang/blaze3d/vertex/VertexFormat;
-
drawMode
- Mappings:
Namespace Name Mixin selector named drawModeLnet/minecraft/client/render/BufferBuilder;drawMode:Lcom/mojang/blaze3d/vertex/VertexFormat$DrawMode;intermediary field_52073Lnet/minecraft/class_287;field_52073:Lcom/mojang/blaze3d/vertex/VertexFormat$class_5596;official hLfkz;h:Lcom/mojang/blaze3d/vertex/VertexFormat$b;
-
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 in.invalid reference
#vertex(float, float, float, float, float, float, float, float, float, int, int, float, float, float)- Mappings:
Namespace Name Mixin selector named canSkipElementChecksLnet/minecraft/client/render/BufferBuilder;canSkipElementChecks:Zintermediary field_21594Lnet/minecraft/class_287;field_21594:Zofficial iLfkz;i:Z
-
hasOverlay
private final boolean hasOverlay- Mappings:
Namespace Name Mixin selector named hasOverlayLnet/minecraft/client/render/BufferBuilder;hasOverlay:Zintermediary field_21595Lnet/minecraft/class_287;field_21595:Zofficial jLfkz;j:Z
-
vertexSizeByte
private final int vertexSizeByte- Mappings:
Namespace Name Mixin selector named vertexSizeByteLnet/minecraft/client/render/BufferBuilder;vertexSizeByte:Iintermediary field_52074Lnet/minecraft/class_287;field_52074:Iofficial kLfkz;k:I
-
requiredMask
private final int requiredMask- Mappings:
Namespace Name Mixin selector named requiredMaskLnet/minecraft/client/render/BufferBuilder;requiredMask:Iintermediary field_52075Lnet/minecraft/class_287;field_52075:Iofficial lLfkz;l:I
-
offsetsByElementId
private final int[] offsetsByElementId- Mappings:
Namespace Name Mixin selector named offsetsByElementIdLnet/minecraft/client/render/BufferBuilder;offsetsByElementId:[Iintermediary field_52076Lnet/minecraft/class_287;field_52076:[Iofficial mLfkz;m:[I
-
currentMask
private int currentMask- Mappings:
Namespace Name Mixin selector named currentMaskLnet/minecraft/client/render/BufferBuilder;currentMask:Iintermediary field_52077Lnet/minecraft/class_287;field_52077:Iofficial nLfkz;n:I
-
building
private boolean building- Mappings:
Namespace Name Mixin selector named buildingLnet/minecraft/client/render/BufferBuilder;building:Zintermediary field_1556Lnet/minecraft/class_287;field_1556:Zofficial oLfkz;o:Z
-
-
Constructor Details
-
BufferBuilder
public BufferBuilder(BufferAllocator allocator, VertexFormat.DrawMode drawMode, VertexFormat vertexFormat) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/client/render/BufferBuilder;<init>(Lnet/minecraft/client/util/BufferAllocator;Lcom/mojang/blaze3d/vertex/VertexFormat$DrawMode;Lcom/mojang/blaze3d/vertex/VertexFormat;)Vintermediary <init>Lnet/minecraft/class_287;<init>(Lnet/minecraft/class_9799;Lcom/mojang/blaze3d/vertex/VertexFormat$class_5596;Lcom/mojang/blaze3d/vertex/VertexFormat;)Vofficial <init>Lfkz;<init>(Lfla;Lcom/mojang/blaze3d/vertex/VertexFormat$b;Lcom/mojang/blaze3d/vertex/VertexFormat;)V
-
-
Method Details
-
endNullable
- Mappings:
Namespace Name Mixin selector named endNullableLnet/minecraft/client/render/BufferBuilder;endNullable()Lnet/minecraft/client/render/BuiltBuffer;intermediary method_60794Lnet/minecraft/class_287;method_60794()Lnet/minecraft/class_9801;official aLfkz;a()Lflc;
-
end
- Mappings:
Namespace Name Mixin selector named endLnet/minecraft/client/render/BufferBuilder;end()Lnet/minecraft/client/render/BuiltBuffer;intermediary method_60800Lnet/minecraft/class_287;method_60800()Lnet/minecraft/class_9801;official bLfkz;b()Lflc;
-
ensureBuilding
private void ensureBuilding()- Mappings:
Namespace Name Mixin selector named ensureBuildingLnet/minecraft/client/render/BufferBuilder;ensureBuilding()Vintermediary method_60802Lnet/minecraft/class_287;method_60802()Vofficial cLfkz;c()V
-
build
- Mappings:
Namespace Name Mixin selector named buildLnet/minecraft/client/render/BufferBuilder;build()Lnet/minecraft/client/render/BuiltBuffer;intermediary method_60804Lnet/minecraft/class_287;method_60804()Lnet/minecraft/class_9801;official dLfkz;d()Lflc;
-
beginVertex
private long beginVertex()- Mappings:
Namespace Name Mixin selector named beginVertexLnet/minecraft/client/render/BufferBuilder;beginVertex()Jintermediary method_60805Lnet/minecraft/class_287;method_60805()Jofficial eLfkz;e()J
-
beginElement
- Mappings:
Namespace Name Mixin selector named beginElementLnet/minecraft/client/render/BufferBuilder;beginElement(Lcom/mojang/blaze3d/vertex/VertexFormatElement;)Jintermediary method_60798Lnet/minecraft/class_287;method_60798(Lcom/mojang/blaze3d/vertex/VertexFormatElement;)Jofficial aLfkz;a(Lcom/mojang/blaze3d/vertex/VertexFormatElement;)J
-
endVertex
private void endVertex()- Mappings:
Namespace Name Mixin selector named endVertexLnet/minecraft/client/render/BufferBuilder;endVertex()Vintermediary method_60806Lnet/minecraft/class_287;method_60806()Vofficial fLfkz;f()V
-
putColor
private static void putColor(long pointer, int argb) - Mappings:
Namespace Name Mixin selector named putColorLnet/minecraft/client/render/BufferBuilder;putColor(JI)Vintermediary method_60797Lnet/minecraft/class_287;method_60797(JI)Vofficial aLfkz;a(JI)V
-
putInt
private static void putInt(long pointer, int i) - Mappings:
Namespace Name Mixin selector named putIntLnet/minecraft/client/render/BufferBuilder;putInt(JI)Vintermediary method_60801Lnet/minecraft/class_287;method_60801(JI)Vofficial bLfkz;b(JI)V
-
vertex
Specifies theof the current vertex.invalid reference
position element
This is typically the first element in a vertex, hence the name.
- Specified by:
vertexin interfaceVertexConsumer- Returns:
- this consumer, for chaining
- Throws:
IllegalStateException- if this consumer is not currently accepting a position element.- Mappings:
Namespace Name Mixin selector named vertexLnet/minecraft/client/render/VertexConsumer;vertex(FFF)Lnet/minecraft/client/render/VertexConsumer;intermediary method_22912Lnet/minecraft/class_4588;method_22912(FFF)Lnet/minecraft/class_4588;official aLflg;a(FFF)Lflg;
-
color
Specifies theof the current vertex.invalid reference
color element
- Specified by:
colorin 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 in.invalid reference
#fixedColor- Mappings:
Namespace Name Mixin selector named colorLnet/minecraft/client/render/VertexConsumer;color(IIII)Lnet/minecraft/client/render/VertexConsumer;intermediary method_1336Lnet/minecraft/class_4588;method_1336(IIII)Lnet/minecraft/class_4588;official aLflg;a(IIII)Lflg;
-
color
Specifies theof the current vertex.invalid reference
color element
- Specified by:
colorin 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 in.invalid reference
#fixedColor- Mappings:
Namespace Name Mixin selector named colorLnet/minecraft/client/render/VertexConsumer;color(I)Lnet/minecraft/client/render/VertexConsumer;intermediary method_39415Lnet/minecraft/class_4588;method_39415(I)Lnet/minecraft/class_4588;official aLflg;a(I)Lflg;
-
texture
Specifies theof the current vertex.invalid reference
texture element
- Specified by:
texturein interfaceVertexConsumer- Returns:
- this consumer, for chaining
- Throws:
IllegalStateException- if this consumer is not currently accepting a texture element.- Mappings:
Namespace Name Mixin selector named textureLnet/minecraft/client/render/VertexConsumer;texture(FF)Lnet/minecraft/client/render/VertexConsumer;intermediary method_22913Lnet/minecraft/class_4588;method_22913(FF)Lnet/minecraft/class_4588;official aLflg;a(FF)Lflg;
-
overlay
Specifies theof the current vertex.invalid reference
overlay element
- Specified by:
overlayin interfaceVertexConsumer- Returns:
- this consumer, for chaining
- Throws:
IllegalStateException- if this consumer is not currently accepting an overlay element.- Mappings:
Namespace Name Mixin selector named overlayLnet/minecraft/client/render/VertexConsumer;overlay(II)Lnet/minecraft/client/render/VertexConsumer;intermediary method_60796Lnet/minecraft/class_4588;method_60796(II)Lnet/minecraft/class_4588;official aLflg;a(II)Lflg;
-
overlay
Specifies theof the current vertex.invalid reference
overlay element
- Specified by:
overlayin interfaceVertexConsumer- Returns:
- this consumer, for chaining
- Throws:
IllegalStateException- if this consumer is not currently accepting an overlay element.- Mappings:
Namespace Name Mixin selector named overlayLnet/minecraft/client/render/VertexConsumer;overlay(I)Lnet/minecraft/client/render/VertexConsumer;intermediary method_22922Lnet/minecraft/class_4588;method_22922(I)Lnet/minecraft/class_4588;official bLflg;b(I)Lflg;
-
light
Specifies theof the current vertex.invalid reference
light element
- Specified by:
lightin interfaceVertexConsumer- Returns:
- this consumer, for chaining
- Throws:
IllegalStateException- if this consumer is not currently accepting a light element.- Mappings:
Namespace Name Mixin selector named lightLnet/minecraft/client/render/VertexConsumer;light(II)Lnet/minecraft/client/render/VertexConsumer;intermediary method_22921Lnet/minecraft/class_4588;method_22921(II)Lnet/minecraft/class_4588;official bLflg;b(II)Lflg;
-
light
Specifies theof the current vertex.invalid reference
light element
- Specified by:
lightin interfaceVertexConsumer- Returns:
- this consumer, for chaining
- Throws:
IllegalStateException- if this consumer is not currently accepting a light element.- Mappings:
Namespace Name Mixin selector named lightLnet/minecraft/client/render/VertexConsumer;light(I)Lnet/minecraft/client/render/VertexConsumer;intermediary method_60803Lnet/minecraft/class_4588;method_60803(I)Lnet/minecraft/class_4588;official cLflg;c(I)Lflg;
-
uv
- Mappings:
Namespace Name Mixin selector named uvLnet/minecraft/client/render/BufferBuilder;uv(SSLcom/mojang/blaze3d/vertex/VertexFormatElement;)Lnet/minecraft/client/render/VertexConsumer;intermediary method_60799Lnet/minecraft/class_287;method_60799(SSLcom/mojang/blaze3d/vertex/VertexFormatElement;)Lnet/minecraft/class_4588;official aLfkz;a(SSLcom/mojang/blaze3d/vertex/VertexFormatElement;)Lflg;
-
normal
Specifies theof the current vertex.invalid reference
normal element
- Specified by:
normalin interfaceVertexConsumer- Returns:
- this consumer, for chaining
- Throws:
IllegalStateException- if this consumer is not currently accepting a normal element.- Mappings:
Namespace Name Mixin selector named normalLnet/minecraft/client/render/VertexConsumer;normal(FFF)Lnet/minecraft/client/render/VertexConsumer;intermediary method_22914Lnet/minecraft/class_4588;method_22914(FFF)Lnet/minecraft/class_4588;official bLflg;b(FFF)Lflg;
-
floatToByte
private static byte floatToByte(float f) - Mappings:
Namespace Name Mixin selector named floatToByteLnet/minecraft/client/render/BufferBuilder;floatToByte(F)Bintermediary method_60795Lnet/minecraft/class_287;method_60795(F)Bofficial aLfkz;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 the,invalid reference
position
,invalid reference
color
,invalid reference
texture
,invalid reference
overlay
, andinvalid reference
light
elements of the current vertex and starts consuming the next vertex.invalid reference
normal
- Specified by:
vertexin interfaceVertexConsumer- Throws:
IllegalStateException- if a color has been set in.invalid reference
#fixedColor- Mappings:
Namespace Name Mixin selector named vertexLnet/minecraft/client/render/VertexConsumer;vertex(FFFIFFIIFFF)Vintermediary method_23919Lnet/minecraft/class_4588;method_23919(FFFIFFIIFFF)Vofficial aLflg;a(FFFIFFIIFFF)V
-