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
draw modes, this builder
duplicates every vertex in a line to produce a quad with zero area. See
invalid reference
LINE_STRIPRenderLayer.getLines().
- Mappings:
Namespace Name named net/minecraft/client/render/BufferBuilderintermediary net/minecraft/class_287official fwu
-
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 static final intprivate 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
method_75298(float float2) 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_61051
private static final int field_61051- See Also:
- Mappings:
Namespace Name Mixin selector named field_61051Lnet/minecraft/client/render/BufferBuilder;field_61051:Iintermediary field_61051Lnet/minecraft/class_287;field_61051:Iofficial aLfwu;a:I
-
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 bLfwu;b: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 cLfwu;c: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 dLfwu;d: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 eLfwu;e:Lfwv;
-
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 fLfwu;f: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 gLfwu;g: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 hLfwu;h: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 iLfwu;i: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 jLfwu;j: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 kLfwu;k: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 lLfwu;l: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 mLfwu;m: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 nLfwu;n:[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 oLfwu;o: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 pLfwu;p: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>Lfwu;<init>(Lfwv;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 aLfwu;a()Lfwy;
-
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 bLfwu;b()Lfwy;
-
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 cLfwu;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 dLfwu;d()Lfwy;
-
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 eLfwu;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 aLfwu;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 fLfwu;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 aLfwu;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 bLfwu;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 aLfxc;a(FFF)Lfxc;
-
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 aLfxc;a(IIII)Lfxc;
-
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 aLfxc;a(I)Lfxc;
-
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 aLfxc;a(FF)Lfxc;
-
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 aLfxc;a(II)Lfxc;
-
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 bLfxc;b(I)Lfxc;
-
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 bLfxc;b(II)Lfxc;
-
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 cLfxc;c(I)Lfxc;
-
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 aLfwu;a(SSLcom/mojang/blaze3d/vertex/VertexFormatElement;)Lfxc;
-
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 bLfxc;b(FFF)Lfxc;
-
method_75298
- Specified by:
method_75298in interfaceVertexConsumer- Mappings:
Namespace Name Mixin selector named method_75298Lnet/minecraft/client/render/VertexConsumer;method_75298(F)Lnet/minecraft/client/render/VertexConsumer;intermediary method_75298Lnet/minecraft/class_4588;method_75298(F)Lnet/minecraft/class_4588;official aLfxc;a(F)Lfxc;
-
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 bLfwu;b(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 aLfxc;a(FFFIFFIIFFF)V
-