Player Location On Placement
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.
The state may be a prediction of where the player will be when the block is actually placed (scaffold predicts it to pre-aim). It is only what the aim is derived from: whether the click is possible right now has to be verified against the eye the server will use for the interaction, see BlockPlacementTarget.doesCrosshairTargetMatchRequirements.
Parameters
position
the player's position (on placement)
pose
the player's pose (on placement)
rotation
the rotation to aim from. Target finding keeps the rotation change minimal relative to it
moving Horizontally
whether the player moves horizontally (on placement)