pub trait Explosion {
// Required methods
fn world(&self) -> &Arc<World> ⓘ;
fn damage_source(&self) -> &DamageSource;
fn block_interaction(&self) -> BlockInteraction;
fn indirect_source_entity(&self) -> Option<&dyn Entity>;
fn direct_source_entity(&self) -> Option<&dyn Entity>;
fn radius(&self) -> f32;
fn center(&self) -> DVec3;
fn should_affect_blocklike_entities(&self) -> bool;
}Expand description
Read-only explosion context exposed to blocks, entities, and calculators.
Required Methods§
Sourcefn damage_source(&self) -> &DamageSource
fn damage_source(&self) -> &DamageSource
Returns the damage source carried by this explosion.
Sourcefn block_interaction(&self) -> BlockInteraction
fn block_interaction(&self) -> BlockInteraction
Returns the resolved block interaction policy.
Sourcefn 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.
Sourcefn direct_source_entity(&self) -> Option<&dyn Entity>
fn direct_source_entity(&self) -> Option<&dyn Entity>
Returns the entity directly creating this explosion, if any.
Sourcefn should_affect_blocklike_entities(&self) -> bool
fn should_affect_blocklike_entities(&self) -> bool
Returns whether block-like entities may be affected.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".