Interface RenderContext
Only the renderer should implement or extend this interface.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Deprecated.static interface
-
Method Summary
Modifier and TypeMethodDescriptiondefault RenderContext.BakedModelConsumer
Deprecated.default Consumer<BakedModel>
Deprecated.UseemitBlockQuads
oremitItemQuads
on the baked model that you want to consume instead.Returns aQuadEmitter
instance that is used to output quads.Deprecated.UseMesh.outputTo(QuadEmitter)
instead.void
Removes the transformation added by the last call topushTransform(QuadTransform)
.void
pushTransform
(RenderContext.QuadTransform transform) Causes all models/quads/meshes sent to this consumer to be transformed by the providedRenderContext.QuadTransform
that edits each quad before buffering.
-
Method Details
-
getEmitter
QuadEmitter getEmitter()Returns aQuadEmitter
instance that is used to output quads. It is necessary to callQuadEmitter.emit()
to output a quad.The renderer may optimize certain operations such as
Mesh.outputTo(QuadEmitter)
when used with this emitter. Thus, using those operations is preferred to using the emitter directly. It should be used sparingly for model components that demand it - text, icons, dynamic indicators, or other elements that vary too much for static baking to be feasible.Calling this method invalidates any
QuadEmitter
returned earlier. Will be thread-local/re-used - do not retain references. -
pushTransform
Causes all models/quads/meshes sent to this consumer to be transformed by the providedRenderContext.QuadTransform
that edits each quad before buffering. Quads in the mesh will be passed to theRenderContext.QuadTransform
for modification before offsets, face culling or lighting are applied. Meant for animation and mesh customization.You MUST call
popTransform()
after model is done outputting quads.More than one transformer can be added to the context. Transformers are applied in reverse order. (Last pushed is applied first.)
Meshes are never mutated by the transformer - only buffered quads. This ensures thread-safe use of meshes/models across multiple chunk builders.
-
popTransform
void popTransform()Removes the transformation added by the last call topushTransform(QuadTransform)
. MUST be called before exiting fromFabricBakedModel
.emit... methods. -
meshConsumer
Deprecated.UseMesh.outputTo(QuadEmitter)
instead. -
bakedModelConsumer
Deprecated.UseemitBlockQuads
oremitItemQuads
on the baked model that you want to consume instead. -
fallbackConsumer
Deprecated.UseemitBlockQuads
oremitItemQuads
on the baked model that you want to consume instead.
-
emitBlockQuads
oremitItemQuads
on the baked model that you want to consume instead.