Interface WorldRenderContext
WorldRenderer.render(net.minecraft.client.util.ObjectAllocator, net.minecraft.client.render.RenderTickCounter, boolean, net.minecraft.client.render.Camera, net.minecraft.client.render.GameRenderer, org.joml.Matrix4f, org.joml.Matrix4f).-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceUsed inWorldRenderEvents.BLOCK_OUTLINEto convey the parameters normally sent toWorldRenderer.drawBlockOutline. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest to know if "fabulous" graphics mode is enabled.booleancamera()@Nullable VertexConsumerProviderTheVertexConsumerProviderinstance being used by the world renderer for most non-terrain renders.@Nullable Frustumfrustum()View frustum, after it is initialized.@Nullable MatrixStackThe matrix stack is only not null inWorldRenderEvents.AFTER_ENTITIESor later events.org.joml.Matrix4forg.joml.Matrix4fbooleanMeant to be used inWorldRenderEvents.BEFORE_BLOCK_OUTLINEandWorldRenderEvents.BLOCK_OUTLINE.world()Convenient access to {WorldRenderer.world}.The world renderer instance doing the rendering and invoking the event.
-
Method Details
-
worldRenderer
WorldRenderer worldRenderer()The world renderer instance doing the rendering and invoking the event.- Returns:
- WorldRenderer instance invoking the event
-
tickCounter
RenderTickCounter tickCounter() -
blockOutlines
boolean blockOutlines() -
camera
Camera camera() -
gameRenderer
GameRenderer gameRenderer() -
positionMatrix
org.joml.Matrix4f positionMatrix() -
projectionMatrix
org.joml.Matrix4f projectionMatrix() -
world
ClientWorld world()Convenient access to {WorldRenderer.world}.- Returns:
- world renderer's client world instance
-
advancedTranslucency
boolean advancedTranslucency()Test to know if "fabulous" graphics mode is enabled.Use this for renders that need to render on top of all translucency to activate or deactivate different event handlers to get optimal depth testing results. When fabulous is off, it may be better to render during
WorldRenderLastCallbackafter clouds and weather are drawn. Conversely, when fabulous mode is on, it may be better to draw duringWorldRenderPostTranslucentCallback, before the fabulous mode composite shader runs, depending on which translucent buffer is being targeted.- Returns:
truewhen "fabulous" graphics mode is enabled.
-
consumers
TheVertexConsumerProviderinstance being used by the world renderer for most non-terrain renders. Generally this will be better for most use cases because quads for the same layer can be buffered incrementally and then drawn all at once by the world renderer.IMPORTANT - all vertex coordinates sent to consumers should be relative to the camera to be consistent with other quads emitted by the world renderer and other mods. If this isn't possible, caller should use a separate "immediate" instance.
This property is
nullbeforeWorldRenderEvents.BEFORE_ENTITIESand afterWorldRenderEvents.BLOCK_OUTLINE(translucent) because the consumer buffers are not available before or drawn after that in vanilla world rendering. Renders that cannot draw in one of the supported events must be drawn directly to the frame buffer, preferably inWorldRenderEvents.LASTto avoid being overdrawn or cleared. -
frustum
View frustum, after it is initialized. Will benullduringWorldRenderEvents.START. -
matrixStack
The matrix stack is only not null inWorldRenderEvents.AFTER_ENTITIESor later events. -
translucentBlockOutline
boolean translucentBlockOutline()Meant to be used inWorldRenderEvents.BEFORE_BLOCK_OUTLINEandWorldRenderEvents.BLOCK_OUTLINE.- Returns:
trueif the current block outline is being rendered after translucent terrain;falseif it is being rendered after solid terrain
-