Struct PlacementContext
#[non_exhaustive]pub struct PlacementContext {
pub pos: BlockPos,
pub hit_pos: BlockPos,
pub face: Direction,
pub hit: [f64; 3],
pub inside: bool,
pub yaw: f32,
pub pitch: f32,
pub sneaking: bool,
pub item: Option<ItemKey>,
pub replace_clicked: bool,
}Expand description
Inputs to selecting a block’s placement state.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.pos: BlockPosResolved destination of the block being placed.
hit_pos: BlockPosPosition of the clicked block.
face: DirectionClicked face.
hit: [f64; 3]World-space click location.
inside: boolWhether the click originated inside the block’s shape.
yaw: f32Placer yaw in degrees.
pitch: f32Placer pitch in degrees.
sneaking: boolWhether secondary use is active.
item: Option<ItemKey>The resolved item in the placing hand; None for an empty hand.
replace_clicked: boolWhether the clicked block itself is replaced.
Implementations§
§impl PlacementContext
impl PlacementContext
Trait Implementations§
§impl Clone for PlacementContext
impl Clone for PlacementContext
§fn clone(&self) -> PlacementContext
fn clone(&self) -> PlacementContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for PlacementContext
impl Debug for PlacementContext
§impl PartialEq for PlacementContext
impl PartialEq for PlacementContext
impl StructuralPartialEq for PlacementContext
Auto Trait Implementations§
impl Freeze for PlacementContext
impl RefUnwindSafe for PlacementContext
impl Send for PlacementContext
impl Sync for PlacementContext
impl Unpin for PlacementContext
impl UnsafeUnpin for PlacementContext
impl UnwindSafe for PlacementContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more