Class BlockRenderLayerMap
java.lang.Object
net.fabricmc.fabric.api.client.rendering.v1.BlockRenderLayerMap
Use to associate blocks or fluids with block render layer other than default (solid).
RenderLayers
control how sprite pixels for fluids and blocks are blended with the scene. Consult the
vanilla RenderLayers
implementation for examples.
The Fabric Renderer API can be used to control this at a per-quad level via BlendMode
.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
putBlock
(Block block, BlockRenderLayer layer) Map (or re-map) a block to a render layer.static void
putBlocks
(BlockRenderLayer layer, Block... blocks) Map (or re-map) multiple blocks to a render layer.static void
putFluid
(Fluid fluid, BlockRenderLayer layer) Map (or re-map) a fluid to a render layer.static void
putFluids
(BlockRenderLayer layer, Fluid... fluids) Map (or re-map) multiple fluids to a render layer.
-
Method Details
-
putBlock
Map (or re-map) a block to a render layer. Re-mapping is not recommended but if done, last one in wins. Must be called from client thread prior to world load/rendering. Best practice will be to call from mod's client initializer.- Parameters:
block
- the block to be mappedlayer
- the render layer
-
putBlocks
Map (or re-map) multiple blocks to a render layer. Re-mapping is not recommended but if done, last one in wins. Must be called from client thread prior to world load/rendering. Best practice will be to call from mod's client initializer.- Parameters:
layer
- the render layerblocks
- the blocks to be mapped
-
putFluid
Map (or re-map) a fluid to a render layer. Re-mapping is not recommended but if done, last one in wins. Must be called from client thread prior to world load/rendering. Best practice will be to call from mod's client initializer.- Parameters:
fluid
- the fluid to be mappedlayer
- the render layer
-
putFluids
Map (or re-map) multiple fluids to a render layer. Re-mapping is not recommended but if done, last one in wins. Must be called from client thread prior to world load/rendering. Best practice will be to call from mod's client initializer.- Parameters:
layer
- the render layerfluids
- the fluids to be mapped
-