Class AddSectionGeometryEvent.SectionRenderingContext

java.lang.Object
net.neoforged.neoforge.client.event.AddSectionGeometryEvent.SectionRenderingContext
Enclosing class:
AddSectionGeometryEvent

public static final class AddSectionGeometryEvent.SectionRenderingContext extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Function<net.minecraft.client.renderer.RenderType,com.mojang.blaze3d.vertex.VertexConsumer>
     
    private final com.mojang.blaze3d.vertex.PoseStack
     
    private final net.minecraft.world.level.BlockAndTintGetter
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SectionRenderingContext(Function<net.minecraft.client.renderer.RenderType,com.mojang.blaze3d.vertex.VertexConsumer> getOrCreateLayer, net.minecraft.world.level.BlockAndTintGetter region, com.mojang.blaze3d.vertex.PoseStack poseStack)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.mojang.blaze3d.vertex.VertexConsumer
    getOrCreateChunkBuffer(net.minecraft.client.renderer.RenderType type)
    Returns the builder for the given render type/layer in the chunk section.
    com.mojang.blaze3d.vertex.PoseStack
     
    net.minecraft.world.level.BlockAndTintGetter
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • getOrCreateLayer

      private final Function<net.minecraft.client.renderer.RenderType,com.mojang.blaze3d.vertex.VertexConsumer> getOrCreateLayer
    • region

      private final net.minecraft.world.level.BlockAndTintGetter region
    • poseStack

      private final com.mojang.blaze3d.vertex.PoseStack poseStack
  • Constructor Details

    • SectionRenderingContext

      public SectionRenderingContext(Function<net.minecraft.client.renderer.RenderType,com.mojang.blaze3d.vertex.VertexConsumer> getOrCreateLayer, net.minecraft.world.level.BlockAndTintGetter region, com.mojang.blaze3d.vertex.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 blocks
      poseStack - the transformations to use, currently set to the chunk origin at unit scaling and no rotation.
  • Method Details

    • getOrCreateChunkBuffer

      public com.mojang.blaze3d.vertex.VertexConsumer getOrCreateChunkBuffer(net.minecraft.client.renderer.RenderType type)
      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 in RenderType.chunkBufferLayers().
      Returns:
      a vertex consumer adding geometry of the specified layer
      Throws:
      IllegalArgumentException - if the passed render type is not in RenderType.chunkBufferLayers().
    • getPoseStack

      public com.mojang.blaze3d.vertex.PoseStack getPoseStack()
    • getRegion

      public net.minecraft.world.level.BlockAndTintGetter 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.