Pumpkin/pumpkin-protocol/src/client/play/c_particle.rs
Alexander Medvedev ee485056fb rename pumpkin-core to pumpkin-util
I see that there is an confusion between the pumpkin-core crate,  People often think that this is the most important one
2025-01-09 13:12:57 +01:00

41 lines
898 B
Rust

use pumpkin_macros::client_packet;
use pumpkin_util::math::vector3::Vector3;
use serde::Serialize;
use crate::VarInt;
#[derive(Serialize)]
#[client_packet("play:level_particles")]
pub struct CParticle<'a> {
/// If true, particle distance increases from 256 to 65536.
long_distance: bool,
position: Vector3<f64>,
offset: Vector3<f64>,
max_speed: f32,
particle_count: i32,
pariticle_id: VarInt,
data: &'a [u8],
}
impl<'a> CParticle<'a> {
pub fn new(
long_distance: bool,
position: Vector3<f64>,
offset: Vector3<f64>,
max_speed: f32,
particle_count: i32,
pariticle_id: VarInt,
data: &'a [u8],
) -> Self {
Self {
long_distance,
position,
offset,
max_speed,
particle_count,
pariticle_id,
data,
}
}
}