Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class BlockOffsetOptions(val offsetsToInvestigate: List<Vec3i>, val priorityComparator: Comparator<BlockPos>)

Contains information about offsets (to the target pos) which should be investigated.

Link copied to clipboard
data class BlockPlacementTarget(val interactedBlockPos: BlockPos, val placedBlock: BlockPos, val direction: Direction, val interactionPoint: Vec3, val minPlacementY: Double, val rotation: Rotation)
Link copied to clipboard
data class BlockPlacementTargetFindingOptions(val offsetOptions: BlockOffsetOptions, val faceHandlingOptions: FaceHandlingOptions, val stackToPlaceWith: ItemStack, val playerLocationOnPlacement: PlayerLocationOnPlacement)

Parameters used when generating a targeting plan for a block placement.

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

How the click of a BlockPlacementTarget is traced.

Link copied to clipboard
data class FaceHandlingOptions(val facePositionFactory: FaceTargetPositionFactory, val considerFacingAwayFaces: Boolean = false)

Decides how scaffold processes the faces of the considered target blocks.

Link copied to clipboard
sealed interface FaceTargetPositionFactory
Link copied to clipboard

What a failed click verification reports.

Link copied to clipboard

Always targets the point with the nearest rotation angle to the current rotation angle

Link copied to clipboard
data class PlacementPlan(val targetPos: BlockPos, val placementTarget: BlockPlacementTarget, val hotbarItemSlot: HotbarItemSlot)
Link copied to clipboard
data class PlayerLocationOnPlacement(val position: Vec3 = player.position(), val pose: Pose = player.pose, val rotation: Rotation = RotationManager.serverRotation, val movingHorizontally: Boolean = player.input.keyPresses.anyHorizontal)

Contains the player's state on placement. Everything that depends on the player has to be read from here instead of the live player, so that the aim is derived from one single state.

Link copied to clipboard

Always targets the point with the nearest rotation angle to the current rotation angle. If you have questions, you have to ask @superblaubeere27 because I am too stupid to explain this without a picture.

Functions

Link copied to clipboard

Finds the best way to place BlockPlacementTargetFindingOptions.stackToPlaceWith at pos or, if pos cannot receive it, at one of the positions the offset options investigate (in priority order).

Link copied to clipboard
fun trimFace(face: AlignedFace, scale: Double = 0.15): AlignedFace

Trims a face to be only as wide as the config allows it to be

Link copied to clipboard
fun BlockPlacementTarget.verifyClick(rotation: Rotation = this.rotation, range: Double = max(player.blockInteractionRange(), player.entityInteractionRange()), trace: ClickTrace = ClickTrace.WORLD, onFailure: FailedClick = FailedClick.NOTHING): BlockHitResult?

Verifies that this target can be clicked right now, i.e. that the interaction would be accepted.