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 Summary
FieldsModifier and TypeFieldDescriptionprivate final Cameraprivate final CollisionContextprivate final List<CustomBlockOutlineRenderer> private final booleanprivate final BlockHitResultprivate final booleanprivate final ClientLevelprivate final LevelRendererprivate final LevelRenderStateprivate final BlockPosprivate final BlockState -
Constructor Summary
ConstructorsConstructorDescriptionExtractBlockOutlineRenderStateEvent(LevelRenderer levelRenderer, ClientLevel level, BlockPos pos, BlockState state, BlockHitResult hitResult, CollisionContext collisionContext, boolean inTranslucentPass, boolean highContrast, Camera camera, LevelRenderState levelRenderState) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomRenderer(CustomBlockOutlineRenderer renderer) Add a custom outline renderer to perform non-standard outline rendering.Returns the position of the block whose outline is being extracted.Returns the state of the block whose outline is being extracted.Returns theCollisionContextto use for resolving the block'sVoxelShapes.Returns theBlockHitResultholding the exact position the crosshair points at.getLevel()Returns theClientLevelholding the block whose outline is being extracted.Returns theLevelRendererperforming the extraction.booleanReturns whether the high-contrast outline setting is enabled in the accessibility settings.booleanReturns whether the targeted block has translucent geometry and therefore needs to render its outline in the translucent pass.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
levelRenderer
-
level
-
pos
-
state
-
hitResult
-
collisionContext
-
inTranslucentPass
private final boolean inTranslucentPass -
highContrast
private final boolean highContrast -
camera
-
levelRenderState
-
customRenderers
-
-
Constructor Details
-
ExtractBlockOutlineRenderStateEvent
@Internal public ExtractBlockOutlineRenderStateEvent(LevelRenderer levelRenderer, ClientLevel level, BlockPos pos, BlockState state, BlockHitResult hitResult, CollisionContext collisionContext, boolean inTranslucentPass, boolean highContrast, Camera camera, LevelRenderState levelRenderState)
-
-
Method Details
-
addCustomRenderer
Add a custom outline renderer to perform non-standard outline rendering. -
getLevelRenderer
Returns theLevelRendererperforming the extraction.- Returns:
- the
LevelRendererperforming the extraction
-
getLevel
Returns theClientLevelholding the block whose outline is being extracted.- Returns:
- the
ClientLevelholding the block whose outline is being extracted
-
getBlockPos
Returns the position of the block whose outline is being extracted.- Returns:
- the position of the block whose outline is being extracted
-
getBlockState
Returns the state of the block whose outline is being extracted.- Returns:
- the state of the block whose outline is being extracted
-
getHitResult
Returns theBlockHitResultholding the exact position the crosshair points at.- Returns:
- the
BlockHitResultholding the exact position the crosshair points at
-
getCollisionContext
Returns theCollisionContextto use for resolving the block'sVoxelShapes.- Returns:
- the
CollisionContextto use for resolving the block'sVoxelShapes
-
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
-
getLevelRenderState
-
getCustomRenderers
-