Package net.minecraft.client.renderer
Class BufferBuilder
- java.lang.Object
-
- com.mojang.blaze3d.vertex.DefaultColorVertexBuilder
-
- net.minecraft.client.renderer.BufferBuilder
-
- All Implemented Interfaces:
IVertexBuilder
,IVertexConsumer
,IForgeVertexBuilder
public class BufferBuilder extends DefaultColorVertexBuilder implements IVertexConsumer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BufferBuilder.DrawState
static class
BufferBuilder.State
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer
buffer
private boolean
building
private VertexFormatElement
currentElement
private int
elementIndex
private boolean
fastFormat
private VertexFormat
format
private boolean
fullFormat
private int
lastRenderedCountIndex
private static org.apache.logging.log4j.Logger
LOGGER
private int
mode
private int
nextElementByte
private int
totalRenderedBytes
private int
totalUploadedBytes
private java.util.List<BufferBuilder.DrawState>
vertexCounts
private int
vertices
-
Fields inherited from class com.mojang.blaze3d.vertex.DefaultColorVertexBuilder
defaultA, defaultB, defaultColorSet, defaultG, defaultR
-
-
Constructor Summary
Constructors Constructor Description BufferBuilder(int p_i46275_1_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
begin(int p_181668_1_, VertexFormat p_181668_2_)
boolean
building()
void
clear()
IVertexBuilder
color(int p_225586_1_, int p_225586_2_, int p_225586_3_, int p_225586_4_)
VertexFormatElement
currentElement()
void
discard()
void
end()
void
endVertex()
private void
ensureCapacity(int p_181670_1_)
protected void
ensureVertexCapacity()
private static float
getQuadDistanceFromPlayer(java.nio.FloatBuffer p_181665_0_, float p_181665_1_, float p_181665_2_, float p_181665_3_, int p_181665_4_, int p_181665_5_)
BufferBuilder.State
getState()
VertexFormat
getVertexFormat()
private void
limitToVertex(java.nio.FloatBuffer p_227829_1_, int p_227829_2_)
void
nextElement()
com.mojang.datafixers.util.Pair<BufferBuilder.DrawState,java.nio.ByteBuffer>
popNextBuffer()
void
putBulkData(java.nio.ByteBuffer buffer)
void
putByte(int p_225589_1_, byte p_225589_2_)
void
putFloat(int p_225590_1_, float p_225590_2_)
void
putShort(int p_225591_1_, short p_225591_2_)
void
restoreState(BufferBuilder.State p_178993_1_)
private static int
roundUp(int p_216566_0_)
void
sortQuads(float p_181674_1_, float p_181674_2_, float p_181674_3_)
private void
switchFormat(VertexFormat p_227828_1_)
void
vertex(float p_225588_1_, float p_225588_2_, float p_225588_3_, float p_225588_4_, float p_225588_5_, float p_225588_6_, float p_225588_7_, float p_225588_8_, float p_225588_9_, int p_225588_10_, int p_225588_11_, float p_225588_12_, float p_225588_13_, float p_225588_14_)
-
Methods inherited from class com.mojang.blaze3d.vertex.DefaultColorVertexBuilder
defaultColor
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.client.extensions.IForgeVertexBuilder
addVertexData, addVertexData, addVertexData, addVertexData, applyBakedLighting, applyBakedNormals, getVertexBuilder
-
Methods inherited from interface com.mojang.blaze3d.vertex.IVertexBuilder
color, normal, overlayCoords, putBulkData, putBulkData, uv2, vertex
-
Methods inherited from interface com.mojang.blaze3d.vertex.IVertexConsumer
normal, overlayCoords, uv, uv2, uvShort, vertex
-
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
buffer
private java.nio.ByteBuffer buffer
-
vertexCounts
private final java.util.List<BufferBuilder.DrawState> vertexCounts
-
lastRenderedCountIndex
private int lastRenderedCountIndex
-
totalRenderedBytes
private int totalRenderedBytes
-
nextElementByte
private int nextElementByte
-
totalUploadedBytes
private int totalUploadedBytes
-
vertices
private int vertices
-
currentElement
@Nullable private VertexFormatElement currentElement
-
elementIndex
private int elementIndex
-
mode
private int mode
-
format
private VertexFormat format
-
fastFormat
private boolean fastFormat
-
fullFormat
private boolean fullFormat
-
building
private boolean building
-
-
Method Detail
-
ensureVertexCapacity
protected void ensureVertexCapacity()
-
ensureCapacity
private void ensureCapacity(int p_181670_1_)
-
roundUp
private static int roundUp(int p_216566_0_)
-
sortQuads
public void sortQuads(float p_181674_1_, float p_181674_2_, float p_181674_3_)
-
limitToVertex
private void limitToVertex(java.nio.FloatBuffer p_227829_1_, int p_227829_2_)
-
getState
public BufferBuilder.State getState()
-
getQuadDistanceFromPlayer
private static float getQuadDistanceFromPlayer(java.nio.FloatBuffer p_181665_0_, float p_181665_1_, float p_181665_2_, float p_181665_3_, int p_181665_4_, int p_181665_5_)
-
restoreState
public void restoreState(BufferBuilder.State p_178993_1_)
-
begin
public void begin(int p_181668_1_, VertexFormat p_181668_2_)
-
switchFormat
private void switchFormat(VertexFormat p_227828_1_)
-
end
public void end()
-
putByte
public void putByte(int p_225589_1_, byte p_225589_2_)
- Specified by:
putByte
in interfaceIVertexConsumer
-
putShort
public void putShort(int p_225591_1_, short p_225591_2_)
- Specified by:
putShort
in interfaceIVertexConsumer
-
putFloat
public void putFloat(int p_225590_1_, float p_225590_2_)
- Specified by:
putFloat
in interfaceIVertexConsumer
-
endVertex
public void endVertex()
- Specified by:
endVertex
in interfaceIVertexBuilder
-
nextElement
public void nextElement()
- Specified by:
nextElement
in interfaceIVertexConsumer
-
color
public IVertexBuilder color(int p_225586_1_, int p_225586_2_, int p_225586_3_, int p_225586_4_)
- Specified by:
color
in interfaceIVertexBuilder
- Specified by:
color
in interfaceIVertexConsumer
-
vertex
public void vertex(float p_225588_1_, float p_225588_2_, float p_225588_3_, float p_225588_4_, float p_225588_5_, float p_225588_6_, float p_225588_7_, float p_225588_8_, float p_225588_9_, int p_225588_10_, int p_225588_11_, float p_225588_12_, float p_225588_13_, float p_225588_14_)
- Specified by:
vertex
in interfaceIVertexBuilder
-
popNextBuffer
public com.mojang.datafixers.util.Pair<BufferBuilder.DrawState,java.nio.ByteBuffer> popNextBuffer()
-
clear
public void clear()
-
discard
public void discard()
-
currentElement
public VertexFormatElement currentElement()
- Specified by:
currentElement
in interfaceIVertexConsumer
-
building
public boolean building()
-
putBulkData
public void putBulkData(java.nio.ByteBuffer buffer)
-
getVertexFormat
public VertexFormat getVertexFormat()
-
-