pub struct DefaultExplosionDamageCalculator;Expand description
Vanilla’s source-less default explosion calculator.
Trait Implementations§
Source§impl ExplosionDamageCalculator for DefaultExplosionDamageCalculator
impl ExplosionDamageCalculator for DefaultExplosionDamageCalculator
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.
Source§impl ImmutableExplosionBlockCalculator for DefaultExplosionDamageCalculator
impl ImmutableExplosionBlockCalculator for DefaultExplosionDamageCalculator
Source§fn bounded_block_read_radius(&self) -> Option<u32>
fn bounded_block_read_radius(&self) -> Option<u32>
Returns the greatest per-axis block offset (Chebyshev radius) this calculator reads from
each ray position. Implementations opting in must never increase ray power through a
returned resistance. Read more
Source§fn can_cache_explosion_resistance(&self) -> bool
fn can_cache_explosion_resistance(&self) -> bool
Whether repeated resistance queries for an unchanged position may reuse one result. Read more
Source§fn always_allows_block_explosion(&self) -> bool
fn always_allows_block_explosion(&self) -> bool
Source§fn explosion_resistance(
&self,
_reader: &dyn ExplosionBlockReader,
_pos: BlockPos,
state: BlockStateId,
fluid: FluidState,
) -> Option<f32>
fn explosion_resistance( &self, _reader: &dyn ExplosionBlockReader, _pos: BlockPos, state: BlockStateId, fluid: FluidState, ) -> Option<f32>
Returns the effective resistance at a ray position.
fn should_explode( &self, _reader: &dyn ExplosionBlockReader, _pos: BlockPos, _state: BlockStateId, _power: f32, ) -> bool
Auto Trait Implementations§
impl Freeze for DefaultExplosionDamageCalculator
impl RefUnwindSafe for DefaultExplosionDamageCalculator
impl Send for DefaultExplosionDamageCalculator
impl Sync for DefaultExplosionDamageCalculator
impl Unpin for DefaultExplosionDamageCalculator
impl UnsafeUnpin for DefaultExplosionDamageCalculator
impl UnwindSafe for DefaultExplosionDamageCalculator
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<>>