pub struct EntityBasedExplosionDamageCalculator<'a> {
source: &'a dyn Entity,
}Expand description
Vanilla’s calculator that delegates resistance and block decisions to the source entity.
Fields§
§source: &'a dyn EntityImplementations§
Trait Implementations§
Source§impl ExplosionDamageCalculator for EntityBasedExplosionDamageCalculator<'_>
impl ExplosionDamageCalculator for EntityBasedExplosionDamageCalculator<'_>
Source§fn block_explosion_resistance(
&self,
explosion: &dyn Explosion,
world: &World,
pos: BlockPos,
state: BlockStateId,
fluid: FluidState,
) -> Option<f32>
fn block_explosion_resistance( &self, explosion: &dyn Explosion, world: &World, pos: BlockPos, state: BlockStateId, fluid: FluidState, ) -> Option<f32>
Returns the effective resistance at an affected block position.
Source§fn should_block_explode(
&self,
explosion: &dyn Explosion,
world: &World,
pos: BlockPos,
state: BlockStateId,
power: f32,
) -> bool
fn should_block_explode( &self, explosion: &dyn Explosion, world: &World, pos: BlockPos, state: BlockStateId, power: f32, ) -> bool
Returns whether the current ray may affect this block position.
Source§fn should_damage_entity(
&self,
_explosion: &dyn Explosion,
_entity: &dyn Entity,
) -> bool
fn should_damage_entity( &self, _explosion: &dyn Explosion, _entity: &dyn Entity, ) -> bool
Returns whether the explosion damages this entity.
Source§fn knockback_multiplier(&self, _entity: &dyn Entity) -> f32
fn knockback_multiplier(&self, _entity: &dyn Entity) -> f32
Returns the multiplier applied to this entity’s explosion knockback.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EntityBasedExplosionDamageCalculator<'a>
impl<'a> !UnwindSafe for EntityBasedExplosionDamageCalculator<'a>
impl<'a> Freeze for EntityBasedExplosionDamageCalculator<'a>
impl<'a> Send for EntityBasedExplosionDamageCalculator<'a>
impl<'a> Sync for EntityBasedExplosionDamageCalculator<'a>
impl<'a> Unpin for EntityBasedExplosionDamageCalculator<'a>
impl<'a> UnsafeUnpin for EntityBasedExplosionDamageCalculator<'a>
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<>>