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/BufferBuilderintermediary net/minecraft/class_287official ffq
-
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 VertexFormatprivate final booleanprivate static final booleanprivate final int[]private final intprivate intprivate longprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionBufferBuilder(BufferAllocator allocator, VertexFormat.DrawMode drawMode, VertexFormat format) -
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) private VertexConsumerputUv(short u, short v, VertexFormatElement element) texture(float u, float v) Specifies theof the current vertex.invalid reference
texture 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 aLffq;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 bLffq;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 cLffq;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 dLffq;d:Lffs;
-
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 eLffq;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 fLffq;f:I
-
format
- Mappings:
Namespace Name Mixin selector named formatLnet/minecraft/client/render/BufferBuilder;format:Lnet/minecraft/client/render/VertexFormat;intermediary field_1565Lnet/minecraft/class_287;field_1565:Lnet/minecraft/class_293;official gLffq;g:Lfga;
-
drawMode
- Mappings:
Namespace Name Mixin selector named drawModeLnet/minecraft/client/render/BufferBuilder;drawMode:Lnet/minecraft/client/render/VertexFormat$DrawMode;intermediary field_52073Lnet/minecraft/class_287;field_52073:Lnet/minecraft/class_293$class_5596;official hLffq;h:Lfga$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 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 iLffq;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 jLffq;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 kLffq;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 lLffq;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 mLffq;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 nLffq;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 oLffq;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;)Vintermediary <init>Lnet/minecraft/class_287;<init>(Lnet/minecraft/class_9799;Lnet/minecraft/class_293$class_5596;Lnet/minecraft/class_293;)Vofficial <init>Lffq;<init>(Lffs;Lfga$c;Lfga;)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 aLffq;a()Lffu;
-
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 bLffq;b()Lffu;
-
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 cLffq;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 dLffq;d()Lffu;
-
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 eLffq;e()J
-
beginElement
- Mappings:
Namespace Name Mixin selector named beginElementLnet/minecraft/client/render/BufferBuilder;beginElement(Lnet/minecraft/client/render/VertexFormatElement;)Jintermediary method_60798Lnet/minecraft/class_287;method_60798(Lnet/minecraft/class_296;)Jofficial aLffq;a(Lfgb;)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 fLffq;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 aLffq;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 bLffq;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 aLffz;a(FFF)Lffz;
-
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 aLffz;a(IIII)Lffz;
-
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 aLffz;a(I)Lffz;
-
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 aLffz;a(FF)Lffz;
-
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 aLffz;a(II)Lffz;
-
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 bLffz;b(I)Lffz;
-
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 bLffz;b(II)Lffz;
-
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 cLffz;c(I)Lffz;
-
putUv
- Mappings:
Namespace Name Mixin selector named putUvLnet/minecraft/client/render/BufferBuilder;putUv(SSLnet/minecraft/client/render/VertexFormatElement;)Lnet/minecraft/client/render/VertexConsumer;intermediary method_60799Lnet/minecraft/class_287;method_60799(SSLnet/minecraft/class_296;)Lnet/minecraft/class_4588;official aLffq;a(SSLfgb;)Lffz;
-
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 bLffz;b(FFF)Lffz;
-
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 aLffq;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 aLffz;a(FFFIFFIIFFF)V
-