aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/c_explode.rs
blob: 651c856d62cc0b3b36ed8e52c5371713532c49cc (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;
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: AzBuf> {
    pub value: T,
    #[var]
    pub weight: i32,
}

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