Package net.minecraft.client.render
Class BufferBuilder
java.lang.Object
net.minecraft.client.render.FixedColorVertexConsumer
net.minecraft.client.render.BufferBuilder
- All Implemented Interfaces:
BufferVertexConsumer,VertexConsumer
@Environment(CLIENT) public class BufferBuilder extends FixedColorVertexConsumer implements BufferVertexConsumer
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBufferBuilder.DrawArrayParametersstatic classBufferBuilder.State -
Field Summary
Fields Modifier and Type Field Description private ByteBufferbufferprivate booleanbuildingprivate intbuildStartprivate VertexFormatElementcurrentElementprivate intcurrentElementIdprivate intdrawModeprivate intelementOffsetprivate booleanfield_21594private booleanfield_21595private VertexFormatformatprivate intlastParameterIndexprivate static LoggerLOGGERprivate intnextDrawStartprivate List<BufferBuilder.DrawArrayParameters>parametersprivate intvertexCountFields inherited from class net.minecraft.client.render.FixedColorVertexConsumer
colorFixed, fixedAlpha, fixedBlue, fixedGreen, fixedRed -
Constructor Summary
Constructors Constructor Description BufferBuilder(int initialCapacity) -
Method Summary
Modifier and Type Method Description voidbegin(int drawMode, VertexFormat format)voidclear()VertexConsumercolor(int red, int green, int blue, int alpha)voidend()VertexFormatElementgetCurrentElement()private static floatgetDistanceSq(FloatBuffer buffer, float x, float y, float z, int int2, int int3)protected voidgrow()private voidgrow(int size)booleanisBuilding()private voidmethod_22628(FloatBuffer floatBuffer, int int2)private voidmethod_23918(VertexFormat vertexFormat)voidnext()voidnextElement()com.mojang.datafixers.util.Pair<BufferBuilder.DrawArrayParameters,ByteBuffer>popData()BufferBuilder.StatepopState()voidputByte(int index, byte value)voidputFloat(int index, float value)voidputShort(int index, short value)voidreset()voidrestoreState(BufferBuilder.State state)private static introundBufferSize(int amount)voidsortQuads(float cameraX, float cameraY, float cameraZ)voidvertex(float x, float y, float z, float red, float green, float blue, float alpha, float u, float v, int overlay, int light, float normalX, float normalY, float normalZ)Methods inherited from class net.minecraft.client.render.FixedColorVertexConsumer
fixedColorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
LOGGER
-
buffer
-
parameters
-
lastParameterIndex
private int lastParameterIndex -
buildStart
private int buildStart -
elementOffset
private int elementOffset -
nextDrawStart
private int nextDrawStart -
vertexCount
private int vertexCount -
currentElement
-
currentElementId
private int currentElementId -
drawMode
private int drawMode -
format
-
field_21594
private boolean field_21594 -
field_21595
private boolean field_21595 -
building
private boolean building
-
-
Constructor Details
-
BufferBuilder
public BufferBuilder(int initialCapacity)
-
-
Method Details
-
grow
protected void grow() -
grow
private void grow(int size) -
roundBufferSize
private static int roundBufferSize(int amount) -
sortQuads
public void sortQuads(float cameraX, float cameraY, float cameraZ) -
method_22628
-
popState
-
getDistanceSq
private static float getDistanceSq(FloatBuffer buffer, float x, float y, float z, int int2, int int3) -
restoreState
-
begin
-
method_23918
-
end
public void end() -
putByte
public void putByte(int index, byte value)- Specified by:
putBytein interfaceBufferVertexConsumer
-
putShort
public void putShort(int index, short value)- Specified by:
putShortin interfaceBufferVertexConsumer
-
putFloat
public void putFloat(int index, float value)- Specified by:
putFloatin interfaceBufferVertexConsumer
-
next
public void next()- Specified by:
nextin interfaceVertexConsumer
-
nextElement
public void nextElement()- Specified by:
nextElementin interfaceBufferVertexConsumer
-
color
- Specified by:
colorin interfaceBufferVertexConsumer- Specified by:
colorin interfaceVertexConsumer
-
vertex
public void vertex(float x, float y, float z, float red, float green, float blue, float alpha, float u, float v, int overlay, int light, float normalX, float normalY, float normalZ)- Specified by:
vertexin interfaceVertexConsumer
-
popData
-
clear
public void clear() -
reset
public void reset() -
getCurrentElement
- Specified by:
getCurrentElementin interfaceBufferVertexConsumer
-
isBuilding
public boolean isBuilding()
-