Class ExtractBlockOutlineRenderStateEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ExtractBlockOutlineRenderStateEvent
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent

public final class ExtractBlockOutlineRenderStateEvent extends net.neoforged.bus.api.Event implements net.neoforged.bus.api.ICancellableEvent
Fired after the BlockOutlineRenderState is extracted.

To perform custom outline rendering, a CustomBlockOutlineRenderer needs to be added through this event.

This event is cancellable. If it is canceled, then no outline render state will be submitted and no outline will be rendered.

  • Field Details

  • Constructor Details

  • Method Details

    • addCustomRenderer

      public void addCustomRenderer(CustomBlockOutlineRenderer renderer)
      Add a custom outline renderer to perform non-standard outline rendering.
    • getLevelRenderer

      public LevelRenderer getLevelRenderer()
      Returns the LevelRenderer performing the extraction.
      Returns:
      the LevelRenderer performing the extraction
    • getLevel

      public ClientLevel getLevel()
      Returns the ClientLevel holding the block whose outline is being extracted.
      Returns:
      the ClientLevel holding the block whose outline is being extracted
    • getBlockPos

      public BlockPos getBlockPos()
      Returns the position of the block whose outline is being extracted.
      Returns:
      the position of the block whose outline is being extracted
    • getBlockState

      public BlockState getBlockState()
      Returns the state of the block whose outline is being extracted.
      Returns:
      the state of the block whose outline is being extracted
    • getHitResult

      public BlockHitResult getHitResult()
      Returns the BlockHitResult holding the exact position the crosshair points at.
      Returns:
      the BlockHitResult holding the exact position the crosshair points at
    • getCollisionContext

      public CollisionContext getCollisionContext()
      Returns the CollisionContext to use for resolving the block's VoxelShapes.
      Returns:
      the CollisionContext to use for resolving the block's VoxelShapes
    • isInTranslucentPass

      public boolean isInTranslucentPass()
      Returns whether the targeted block has translucent geometry and therefore needs to render its outline in the translucent pass.
      Returns:
      whether the targeted block has translucent geometry and therefore needs to render its outline in the translucent pass
    • isHighContrast

      public boolean isHighContrast()
      Returns whether the high-contrast outline setting is enabled in the accessibility settings.
      Returns:
      whether the high-contrast outline setting is enabled in the accessibility settings
    • getCamera

      public Camera getCamera()
    • getLevelRenderState

      public LevelRenderState getLevelRenderState()
    • getCustomRenderers

      @Internal public List<CustomBlockOutlineRenderer> getCustomRenderers()