Skip to main content

HumanoidRenderState

Struct HumanoidRenderState 

pub struct HumanoidRenderState<'a> {
    pub main_hand: Option<&'a ItemStack>,
    pub off_hand: Option<&'a ItemStack>,
    pub main_arm_left: bool,
    pub use_hand: Option<Hand>,
    pub ticks_using_item: i32,
    pub use_animation: UseAnimation,
    pub main_arm_pose: ArmPose,
    pub off_arm_pose: ArmPose,
}
Expand description

Borrowed humanoid inputs at arm-pose extraction, shared by players and mobs. Poses are in main/off-hand order, before listeners answer; item declarations are already included. Model-specific animation may subsequently adjust the arms.

Fields§

§main_hand: Option<&'a ItemStack>

Stack held in the main hand; empty stacks are absent.

§off_hand: Option<&'a ItemStack>

Stack held in the off hand; empty stacks are absent.

§main_arm_left: bool

Whether the entity’s main arm is its left arm.

§use_hand: Option<Hand>

Hand currently using an item, absent when no item is in use.

§ticks_using_item: i32

Elapsed item-use ticks at extraction.

§use_animation: UseAnimation

Animation of the item currently being used.

§main_arm_pose: ArmPose

Selected main-hand pose before any hook answers.

§off_arm_pose: ArmPose

Selected off-hand pose before any hook answers.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.