Class ChunkSectionLayerMap

java.lang.Object
net.fabricmc.fabric.api.client.rendering.v1.ChunkSectionLayerMap

public final class ChunkSectionLayerMap extends Object
Use to associate blocks or fluids with a chunk section layer other than default (solid).

ChunkSectionLayer control how sprite pixels for fluids and blocks are blended with the scene. Consult the vanilla ChunkSectionLayer implementation for examples.

The Fabric Renderer API can be used to control this at a per-quad level.

  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    putBlock(net.minecraft.world.level.block.Block block, net.minecraft.client.renderer.chunk.ChunkSectionLayer layer)
    Map (or re-map) a block to a section layer.
    static void
    putBlocks(net.minecraft.client.renderer.chunk.ChunkSectionLayer layer, net.minecraft.world.level.block.Block... blocks)
    Map (or re-map) multiple blocks to a section layer.
    static void
    putFluid(net.minecraft.world.level.material.Fluid fluid, net.minecraft.client.renderer.chunk.ChunkSectionLayer layer)
    Map (or re-map) a fluid to a section layer.
    static void
    putFluids(net.minecraft.client.renderer.chunk.ChunkSectionLayer layer, net.minecraft.world.level.material.Fluid... fluids)
    Map (or re-map) multiple fluids to a section layer.

    Methods inherited from class Object

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

    • putBlock

      public static void putBlock(net.minecraft.world.level.block.Block block, net.minecraft.client.renderer.chunk.ChunkSectionLayer layer)
      Map (or re-map) a block to a section layer. Re-mapping is not recommended but if done, last one in wins. Must be called from client thread prior to level load/rendering. Best practice will be to call from mod's client initializer.
      Parameters:
      block - the block to be mapped
      layer - the section layer
    • putBlocks

      public static void putBlocks(net.minecraft.client.renderer.chunk.ChunkSectionLayer layer, net.minecraft.world.level.block.Block... blocks)
      Map (or re-map) multiple blocks to a section layer. Re-mapping is not recommended but if done, last one in wins. Must be called from client thread prior to level load/rendering. Best practice will be to call from mod's client initializer.
      Parameters:
      layer - the section layer
      blocks - the blocks to be mapped
    • putFluid

      public static void putFluid(net.minecraft.world.level.material.Fluid fluid, net.minecraft.client.renderer.chunk.ChunkSectionLayer layer)
      Map (or re-map) a fluid to a section layer. Re-mapping is not recommended but if done, last one in wins. Must be called from client thread prior to level load/rendering. Best practice will be to call from mod's client initializer.
      Parameters:
      fluid - the fluid to be mapped
      layer - the section layer
    • putFluids

      public static void putFluids(net.minecraft.client.renderer.chunk.ChunkSectionLayer layer, net.minecraft.world.level.material.Fluid... fluids)
      Map (or re-map) multiple fluids to a section layer. Re-mapping is not recommended but if done, last one in wins. Must be called from client thread prior to level load/rendering. Best practice will be to call from mod's client initializer.
      Parameters:
      layer - the section layer
      fluids - the fluids to be mapped