From 6f2fe2c9e5af1f2fa2c1b99c3d4ea0a7e90ae16c Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 16 Dec 2025 09:42:54 -0200 Subject: change KnockbackEvent to an EntityEvent and fix ClientboundExplode representation ty mahtog for pointing out the latter issue <3 --- azalea-protocol/src/packets/game/c_explode.rs | 11 +++++++++-- azalea-protocol/src/packets/game/c_update_advancements.rs | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'azalea-protocol') diff --git a/azalea-protocol/src/packets/game/c_explode.rs b/azalea-protocol/src/packets/game/c_explode.rs index 2c934c31..be86abb6 100644 --- a/azalea-protocol/src/packets/game/c_explode.rs +++ b/azalea-protocol/src/packets/game/c_explode.rs @@ -1,4 +1,4 @@ -use azalea_buf::AzBuf; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite}; use azalea_core::position::Vec3; use azalea_entity::particle::Particle; use azalea_protocol_macros::ClientboundGamePacket; @@ -12,7 +12,14 @@ pub struct ClientboundExplode { pub player_knockback: Option, pub explosion_particle: Particle, pub explosion_sound: SoundEvent, - pub block_particles: Vec, + pub block_particles: Vec>, +} + +#[derive(AzBuf, Clone, Debug, PartialEq)] +pub struct Weighted { + pub value: T, + #[var] + pub weight: i32, } #[derive(AzBuf, Clone, Debug, PartialEq)] diff --git a/azalea-protocol/src/packets/game/c_update_advancements.rs b/azalea-protocol/src/packets/game/c_update_advancements.rs index 07479656..62881b9d 100644 --- a/azalea-protocol/src/packets/game/c_update_advancements.rs +++ b/azalea-protocol/src/packets/game/c_update_advancements.rs @@ -3,7 +3,7 @@ use std::{ io::{self, Cursor, Write}, }; -use azalea_buf::AzBuf; +use azalea_buf::{AzBuf, AzaleaWrite}; use azalea_chat::FormattedText; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; @@ -40,7 +40,7 @@ pub struct DisplayInfo { pub y: f32, } -impl azalea_buf::AzaleaWrite for DisplayInfo { +impl AzaleaWrite for DisplayInfo { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { self.title.azalea_write(buf)?; self.description.azalea_write(buf)?; -- cgit v1.2.3