aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/c_explode.rs
blob: be86abb6159233456522941b23eca3bc7c01655c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite};
use azalea_core::position::Vec3;
use azalea_entity::particle::Particle;
use azalea_protocol_macros::ClientboundGamePacket;
use azalea_registry::builtin::SoundEvent;

#[derive(AzBuf, ClientboundGamePacket, Clone, Debug, PartialEq)]
pub struct ClientboundExplode {
    pub center: Vec3,
    pub radius: f32,
    pub block_count: i32,
    pub player_knockback: Option<Vec3>,
    pub explosion_particle: Particle,
    pub explosion_sound: SoundEvent,
    pub block_particles: Vec<Weighted<ExplosionParticleInfo>>,
}

#[derive(AzBuf, Clone, Debug, PartialEq)]
pub struct Weighted<T: AzaleaRead + AzaleaWrite> {
    pub value: T,
    #[var]
    pub weight: i32,
}

#[derive(AzBuf, Clone, Debug, PartialEq)]
pub struct ExplosionParticleInfo {
    pub particle: Particle,
    pub scaling: f32,
    pub speed: f32,
}