Interface Renderer
Renderers must ensure that terrain buffering supports FabricBlockStateModel.emitQuads(QuadEmitter, BlockAndTintGetter, BlockPos, BlockState, RandomSource, Predicate), if they introduce an
alternate path for it. In vanilla, this happens in SectionCompiler, which is automatically patched to use
altModelBlockRenderer(boolean, boolean, BlockColors).
All places in vanilla code that invoke BlockStateModel.collectParts(RandomSource, List) or
ModelBlockRenderer.tesselateBlock(BlockQuadOutput, float, float, float, BlockAndTintGetter, BlockPos, BlockState, BlockStateModel, long)
are, where appropriate, patched automatically to invoke FabricBlockStateModel.emitQuads(QuadEmitter, BlockAndTintGetter, BlockPos, BlockState, RandomSource, Predicate) or
AltModelBlockRenderer.tesselateBlock(QuadEmitter, float, float, float, BlockAndTintGetter, BlockPos, BlockState, BlockStateModel, long),
respectively, instead.
Renderers must implement FeatureRenderers to support ExtendedBlockModelSubmit
and ExtendedItemSubmit. This is typically done by adding them to
FeatureRenderDispatcher's map with a mixin.
-
Method Summary
Modifier and TypeMethodDescriptionaltModelBlockRenderer(boolean ambientOcclusion, boolean cull, net.minecraft.client.color.block.BlockColors blockColors) Obtain a newAltModelBlockRendererinstance to tesselate blocks with modded quads.static Rendererget()Access to the currentRendererfor creating and retrieving mesh builders and materials.Obtain a newMutableMeshinstance to build optimized meshes and create baked models with enhanced features.quadEmitter(Consumer<? super MutableQuadView> consumer) Obtain a newQuadEmitterinstance that invokes the given consumer onQuadEmitter.emit(), after transforms are applied.static voidRendering extension mods must implementRendererand call this method during initialization.
-
Method Details
-
get
-
register
-
quadEmitter
Obtain a newQuadEmitterinstance that invokes the given consumer onQuadEmitter.emit(), after transforms are applied.- Parameters:
consumer- logic performed when the quad is emitted.
-
mutableMesh
MutableMesh mutableMesh()Obtain a newMutableMeshinstance to build optimized meshes and create baked models with enhanced features.Renderer does not retain a reference to returned instances, so they should be re-used when possible to avoid memory allocation overhead.
-
altModelBlockRenderer
AltModelBlockRenderer altModelBlockRenderer(boolean ambientOcclusion, boolean cull, net.minecraft.client.color.block.BlockColors blockColors) Obtain a newAltModelBlockRendererinstance to tesselate blocks with modded quads. Prefer using this over the vanillaModelBlockRendererto correctly tesselate modded models.
-