Class AddSectionGeometryEvent.SectionRenderingContext
java.lang.Object
net.neoforged.neoforge.client.event.AddSectionGeometryEvent.SectionRenderingContext
- Enclosing class:
AddSectionGeometryEvent
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Function
<RenderType, VertexConsumer> private final PoseStack
private final BlockAndTintGetter
-
Constructor Summary
ConstructorDescriptionSectionRenderingContext
(Function<RenderType, VertexConsumer> getOrCreateLayer, BlockAndTintGetter region, PoseStack poseStack) -
Method Summary
Modifier and TypeMethodDescriptionReturns the builder for the given render type/layer in the chunk section.getQuadLighter
(boolean smooth)
-
Field Details
-
getOrCreateLayer
-
region
-
poseStack
-
-
Constructor Details
-
SectionRenderingContext
public SectionRenderingContext(Function<RenderType, VertexConsumer> getOrCreateLayer, BlockAndTintGetter region, PoseStack poseStack) - 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 blocksposeStack
- the transformations to use, currently set to the chunk origin at unit scaling and no rotation.
-
-
Method Details
-
getOrCreateChunkBuffer
Returns the builder for the given render type/layer in the chunk section. If the render type is not already present in the section, marks the type as present in the section.- Parameters:
type
- the render type to retrieve a builder for. This has to be one of the render types listed inRenderType.chunkBufferLayers()
.- Returns:
- a vertex consumer adding geometry of the specified layer
- Throws:
IllegalArgumentException
- if the passed render type is not inRenderType.chunkBufferLayers()
.
-
getQuadLighter
- Parameters:
smooth
- whether a lighter for "smooth"/"ambient occlusion" lighting should be returned rather than a "flat" one- Returns:
- a quad lighter usable on the current thread
-
getPoseStack
-
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.
-