ClickableCenterTargetPositionFactory

Like CenterTargetPositionFactory, but prefers an unobstructed point on the face.

The face center can be occluded by the block itself when only a small part of the face is visible from the player's eyes. In that case the click point (and therefore the rotation / reach checks) would be wrong, so fall back to sampling the face for the first visible point. If nothing is visible, the center is kept so wall-range placements keep working.

Functions

Link copied to clipboard
open override fun producePositionOnFace(face: AlignedFace, targetPos: BlockPos, playerLocation: PlayerLocationOnPlacement): Vec3

Samples a position (relative to targetPos).