Skip to main content

azalea_protocol/packets/game/
c_explode.rs

1use azalea_buf::AzBuf;
2use azalea_core::position::Vec3;
3use azalea_protocol_macros::ClientboundGamePacket;
4use azalea_registry::{builtin::SoundEvent, registry_holder::particle::Particle};
5
6#[derive(AzBuf, ClientboundGamePacket, Clone, Debug, PartialEq)]
7pub struct ClientboundExplode {
8    pub center: Vec3,
9    pub radius: f32,
10    pub block_count: i32,
11    pub player_knockback: Option<Vec3>,
12    pub explosion_particle: Particle,
13    pub explosion_sound: SoundEvent,
14    pub block_particles: Vec<Weighted<ExplosionParticleInfo>>,
15}
16
17#[derive(AzBuf, Clone, Debug, PartialEq)]
18pub struct Weighted<T: AzBuf> {
19    pub value: T,
20    #[var]
21    pub weight: i32,
22}
23
24#[derive(AzBuf, Clone, Debug, PartialEq)]
25pub struct ExplosionParticleInfo {
26    pub particle: Particle,
27    pub scaling: f32,
28    pub speed: f32,
29}