pub struct BlockAttachedEntityBase {
state: SyncMutex<BlockAttachedEntityState>,
}Expand description
Runtime fields shared by Vanilla’s block-attached entities (those inheriting BlockAttachedEntity in Vanilla).
Fields§
§state: SyncMutex<BlockAttachedEntityState>Implementations§
Source§impl BlockAttachedEntityBase
impl BlockAttachedEntityBase
Sourcepub const fn new(pos: BlockPos) -> Self
pub const fn new(pos: BlockPos) -> Self
Creates a new BlockAttachedEntityBase with the given position.
Sourcepub fn set_pos(&self, pos: BlockPos)
pub fn set_pos(&self, pos: BlockPos)
Sets the position of this base’s entity to the given position.
Sourcepub fn should_check_survival(&self) -> bool
pub fn should_check_survival(&self) -> bool
Increments the internal counter of this base, returning whether to check for survival.
- If it is the maximum value of
CHECK_SURVIVAL_FREQUENCY_TICKS, this returnstrue, and the counter is reset. - If not, this returns
false, and increments the counter.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BlockAttachedEntityBase
impl !RefUnwindSafe for BlockAttachedEntityBase
impl Send for BlockAttachedEntityBase
impl Sync for BlockAttachedEntityBase
impl Unpin for BlockAttachedEntityBase
impl UnsafeUnpin for BlockAttachedEntityBase
impl UnwindSafe for BlockAttachedEntityBase
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<>>