pub(super) struct ServerExplosion<'a> {
world: &'a Arc<World>,
fire: bool,
block_interaction: BlockInteraction,
center: DVec3,
source: Option<SharedEntity>,
indirect_source: Option<SharedEntity>,
radius: f32,
damage_source: DamageSource,
damage_calculator: SelectedDamageCalculator<'a>,
immutable_block_calculator: Option<&'a dyn ImmutableExplosionBlockCalculator>,
pub(super) hit_players: FxHashMap<i32, DVec3>,
}Fields§
§world: &'a Arc<World>§fire: bool§block_interaction: BlockInteraction§center: DVec3§source: Option<SharedEntity>§indirect_source: Option<SharedEntity>§radius: f32§damage_source: DamageSource§damage_calculator: SelectedDamageCalculator<'a>§immutable_block_calculator: Option<&'a dyn ImmutableExplosionBlockCalculator>§hit_players: FxHashMap<i32, DVec3>Implementations§
Source§impl ServerExplosion<'_>
impl ServerExplosion<'_>
pub(super) fn interact_with_blocks( &self, affected: &mut [BlockPos], random: &mut impl Random, )
pub(super) fn create_fire( &self, affected: &[BlockPos], random: &mut impl Random, )
fn create_fire_with(&self, affected: &[BlockPos], next_int: impl FnMut() -> i32)
Source§impl ServerExplosion<'_>
impl ServerExplosion<'_>
pub(super) fn calculate_immutable_ray_powers_with_reader<R: ExplosionBlockReader>( &self, powers: &[f32; 1352], calculator: &dyn ImmutableExplosionBlockCalculator, reader: &R, bounds: BlockRegionBounds, ) -> Option<Vec<BlockPos>>
fn calculate_immutable_ray_powers_with_cache<R: ExplosionBlockReader, C: ExplosionRayBlockCache>( powers: &[f32; 1352], calculator: &dyn ImmutableExplosionBlockCalculator, reader: &R, context: ExplosionRayContext, cache_policy: ImmutableRayCachePolicy, cache: C, use_bounded_floor: bool, ) -> Option<Vec<BlockPos>>
fn calculate_immutable_ray_powers_with_cache_mode<R: ExplosionBlockReader, C: ExplosionRayBlockCache, const USE_BOUNDED_FLOOR: bool>( powers: &[f32; 1352], calculator: &dyn ImmutableExplosionBlockCalculator, reader: &R, context: ExplosionRayContext, cache_policy: ImmutableRayCachePolicy, cache: C, ) -> Option<Vec<BlockPos>>
Source§impl ServerExplosion<'_>
impl ServerExplosion<'_>
pub(super) fn calculate_exploded_positions( &self, next_float: impl FnMut() -> f32, ) -> Vec<BlockPos>
fn immutable_calculator_for_rays( &self, ) -> Option<&dyn ImmutableExplosionBlockCalculator>
fn calculate_immutable_ray_powers( &self, powers: &[f32; 1352], calculator: &dyn ImmutableExplosionBlockCalculator, ) -> Vec<BlockPos>
fn calculate_immutable_ray_powers_uncached_with_reader<R: ExplosionBlockReader>( &self, powers: &[f32; 1352], calculator: &dyn ImmutableExplosionBlockCalculator, reader: &R, ) -> Vec<BlockPos>
fn immutable_ray_region_bounds( &self, read_radius: u32, ) -> Option<BlockRegionBounds>
fn calculate_exploded_positions_sequential( &self, next_float: impl FnMut() -> f32, ) -> Vec<BlockPos>
fn draw_immutable_ray_powers( &self, next_float: impl FnMut() -> f32, ) -> [f32; 1352]
Source§impl ServerExplosion<'_>
impl ServerExplosion<'_>
pub(super) fn hurt_entities(&mut self)
Source§impl<'a> ServerExplosion<'a>
impl<'a> ServerExplosion<'a>
pub(super) fn new( world: &'a Arc<World>, source: Option<SharedEntity>, damage_source: Option<DamageSource>, damage_calculator: Option<&'a dyn ExplosionDamageCalculator>, immutable_block_calculator: Option<&'a dyn ImmutableExplosionBlockCalculator>, center: DVec3, radius: f32, fire: bool, block_interaction: BlockInteraction, ) -> Self
pub(super) fn explode(&mut self) -> usize
fn interacts_with_blocks(&self) -> bool
pub(super) fn is_small(&self) -> bool
Trait Implementations§
Source§impl Explosion for ServerExplosion<'_>
impl Explosion for ServerExplosion<'_>
Source§fn damage_source(&self) -> &DamageSource
fn damage_source(&self) -> &DamageSource
Returns the damage source carried by this explosion.
Source§fn block_interaction(&self) -> BlockInteraction
fn block_interaction(&self) -> BlockInteraction
Returns the resolved block interaction policy.
Source§fn indirect_source_entity(&self) -> Option<&dyn Entity>
fn indirect_source_entity(&self) -> Option<&dyn Entity>
Returns the living entity credited for this explosion, if any.
Source§fn direct_source_entity(&self) -> Option<&dyn Entity>
fn direct_source_entity(&self) -> Option<&dyn Entity>
Returns the entity directly creating this explosion, if any.
Source§fn should_affect_blocklike_entities(&self) -> bool
fn should_affect_blocklike_entities(&self) -> bool
Returns whether block-like entities may be affected.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ServerExplosion<'a>
impl<'a> !UnwindSafe for ServerExplosion<'a>
impl<'a> Freeze for ServerExplosion<'a>
impl<'a> Send for ServerExplosion<'a>
impl<'a> Sync for ServerExplosion<'a>
impl<'a> Unpin for ServerExplosion<'a>
impl<'a> UnsafeUnpin for ServerExplosion<'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<>>