pub struct MinecartBehavior;Expand description
Shared minecart movement behavior.
Implementations§
Source§impl MinecartBehavior
impl MinecartBehavior
pub(crate) fn tick( minecart: &dyn AbstractMinecart, entity: &SharedEntity, world: &World, )
pub(crate) fn motion_direction(minecart: &dyn AbstractMinecart) -> Direction
Sourcepub(crate) fn known_movement(known_movement: DVec3) -> DVec3
pub(crate) fn known_movement(known_movement: DVec3) -> DVec3
Returns the minecart movement used when processing block contacts.
pub(crate) fn max_speed(minecart: &dyn AbstractMinecart, _world: &World) -> f64
pub(crate) fn slowdown_factor(minecart: &dyn AbstractMinecart) -> f64
fn move_along_track( minecart: &dyn AbstractMinecart, entity: &SharedEntity, world: &World, )
Sourcefn set_position(
minecart: &dyn AbstractMinecart,
position: DVec3,
step: &str,
) -> bool
fn set_position( minecart: &dyn AbstractMinecart, position: DVec3, step: &str, ) -> bool
Moves minecart to position, logging step and returning false if the move was
rejected so the caller can end the tick.
Sourcefn push_and_pickup_entities(minecart: &dyn AbstractMinecart) -> bool
fn push_and_pickup_entities(minecart: &dyn AbstractMinecart) -> bool
Returns whether the minecart should continue its movement after pushing or picking up entities.
fn update_rotation_from_movement(minecart: &dyn AbstractMinecart)
Trait Implementations§
Source§impl Debug for MinecartBehavior
impl Debug for MinecartBehavior
Auto Trait Implementations§
impl Freeze for MinecartBehavior
impl RefUnwindSafe for MinecartBehavior
impl Send for MinecartBehavior
impl Sync for MinecartBehavior
impl Unpin for MinecartBehavior
impl UnsafeUnpin for MinecartBehavior
impl UnwindSafe for MinecartBehavior
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>