Skip to main content

Explosion

Trait Explosion 

Source
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§

Source

fn world(&self) -> &Arc<World> ⓘ

Returns the world executing this explosion.

Source

fn damage_source(&self) -> &DamageSource

Returns the damage source carried by this explosion.

Source

fn block_interaction(&self) -> BlockInteraction

Returns the resolved block interaction policy.

Source

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>

Returns the entity directly creating this explosion, if any.

Source

fn radius(&self) -> f32

Returns the explosion radius.

Source

fn center(&self) -> DVec3

Returns the exact explosion center.

Source

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".

Implementors§