Class AddSectionGeometryEvent.SectionRenderingContext
java.lang.Object
net.neoforged.neoforge.client.event.AddSectionGeometryEvent.SectionRenderingContext
- Enclosing class:
AddSectionGeometryEvent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ModelBlockRendererprivate final Function<ChunkSectionLayer, VertexConsumer> private final BlockAndTintGetter -
Constructor Summary
ConstructorsConstructorDescriptionSectionRenderingContext(Function<ChunkSectionLayer, VertexConsumer> getOrCreateLayer, BlockAndTintGetter region, ModelBlockRenderer blockRenderer) -
Method Summary
Modifier and TypeMethodDescriptionReturns the builder for the givenChunkSectionLayerin the chunk section.
-
Field Details
-
getOrCreateLayer
-
region
-
blockRenderer
-
-
Constructor Details
-
SectionRenderingContext
public SectionRenderingContext(Function<ChunkSectionLayer, VertexConsumer> getOrCreateLayer, BlockAndTintGetter region, ModelBlockRenderer blockRenderer) - Parameters:
getOrCreateLayer- a function that, given a "chunk render type", returns the corresponding buffer and adds it to the section if it is not already present.region- a view of the section and some surrounding blocksblockRenderer- the block renderer to use for rendering block models
-
-
Method Details
-
getOrCreateChunkBuffer
Returns the builder for the givenChunkSectionLayerin the chunk section. If the layer is not already present in the section, marks the type as present in the section.- Parameters:
layer- theChunkSectionLayerto retrieve a builder for.- Returns:
- a vertex consumer adding geometry of the specified layer
-
getBlockRenderer
-
getRegion
- Returns:
- the "view" on the client world used in the current chunk meshing thread. This will generally only contain blocks in a small radius around the section being rendered.
-