Add Particles
This commit is contained in:
1 parent
3b43322567
commit
bf92fe22a0
6 files changed
+80
-40
No files matched your search
@@ -0,0 +1,51 @@
|
||||
use pumpkin_macros::packet;
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::VarInt;
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[packet(0x29)]
|
||||
pub struct CParticle<'a> {
|
||||
/// If true, particle distance increases from 256 to 65536.
|
||||
long_distance: bool,
|
||||
x: f64,
|
||||
y: f64,
|
||||
z: f64,
|
||||
offset_x: f32,
|
||||
offset_y: f32,
|
||||
offset_z: f32,
|
||||
max_speed: f32,
|
||||
particle_count: i32,
|
||||
pariticle_id: VarInt,
|
||||
data: &'a [u8],
|
||||
}
|
||||
|
||||
impl<'a> CParticle<'a> {
|
||||
pub fn new(
|
||||
long_distance: bool,
|
||||
x: f64,
|
||||
y: f64,
|
||||
z: f64,
|
||||
offset_x: f32,
|
||||
offset_y: f32,
|
||||
offset_z: f32,
|
||||
max_speed: f32,
|
||||
particle_count: i32,
|
||||
pariticle_id: VarInt,
|
||||
data: &'a [u8],
|
||||
) -> Self {
|
||||
Self {
|
||||
long_distance,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
offset_x,
|
||||
offset_y,
|
||||
offset_z,
|
||||
max_speed,
|
||||
particle_count,
|
||||
pariticle_id,
|
||||
data,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ mod c_head_rot;
|
||||
mod c_hurt_animation;
|
||||
mod c_login;
|
||||
mod c_open_screen;
|
||||
mod c_particle;
|
||||
mod c_play_disconnect;
|
||||
mod c_player_abilities;
|
||||
mod c_player_chat_message;
|
||||
@@ -41,6 +42,7 @@ pub use c_head_rot::*;
|
||||
pub use c_hurt_animation::*;
|
||||
pub use c_login::*;
|
||||
pub use c_open_screen::*;
|
||||
pub use c_particle::*;
|
||||
pub use c_play_disconnect::*;
|
||||
pub use c_player_abilities::*;
|
||||
pub use c_player_chat_message::*;
|
||||
|
||||
Reference in new issue
Block a user