Class LevelExtractionEvents

java.lang.Object
net.fabricmc.fabric.api.client.rendering.v1.level.LevelExtractionEvents

public class LevelExtractionEvents extends Object
Events fired from within LevelExtractor to be used by mods to add or modify extracted render state.
  • Field Details

    • AFTER_BLOCK_OUTLINE_EXTRACTION

      public static final Event<LevelExtractionEvents.AfterBlockOutlineExtraction> AFTER_BLOCK_OUTLINE_EXTRACTION
      Called after the block outline render state is extracted, before it is drawn. Can optionally cancel the default rendering by setting the outline render state to null but all handlers for this event will always be called.

      Use this to extract custom data needed when decorating or replacing the default block outline rendering for specific modded blocks or when normally, the block outline would not be extracted to be rendered. Normally, outline rendering will not happen for entities, fluids, or other game objects that do not register a block-type hit.

      To attach modded data to vanilla render states, see FabricRenderState. Only attach the minimum data needed for rendering. Do not attach objects that are not thread-safe such as ClientLevel.

      Setting the outline render state to null by any event subscriber will cancel the default block outline render and suppress the LevelRenderEvents.BEFORE_BLOCK_OUTLINE event. This has no effect on other subscribers to this event - all subscribers will always be called. Setting outline render state to null here is appropriate when there is still a valid block hit (with a fluid, for example) and you don't want the block outline render to appear.

      This event should NOT be used for general-purpose replacement of the default block outline rendering because it will interfere with mod-specific renders. Mods that replace the default block outline for specific blocks should instead subscribe to LevelRenderEvents.BEFORE_BLOCK_OUTLINE.

    • END_EXTRACTION

      public static final Event<LevelExtractionEvents.EndExtraction> END_EXTRACTION
      Called after all render states are extracted, before any are drawn. Use this to extract general custom data needed for rendering.

      To attach modded data to vanilla render states, see FabricRenderState. Only attach the minimum data needed for rendering. Do not attach objects that are not thread-safe such as ClientLevel.

  • Constructor Details

    • LevelExtractionEvents

      public LevelExtractionEvents()