From d7cd30505954d841f05d85a4cfd74412739778dd Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 2 Jun 2025 10:30:28 +0500 Subject: fix VibrationParticle --- azalea-entity/src/particle.rs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'azalea-entity/src') diff --git a/azalea-entity/src/particle.rs b/azalea-entity/src/particle.rs index 6bc1ef6f..212d9668 100644 --- a/azalea-entity/src/particle.rs +++ b/azalea-entity/src/particle.rs @@ -3,6 +3,7 @@ use azalea_buf::AzBuf; use azalea_core::{color::RgbColor, position::BlockPos}; use azalea_inventory::ItemStack; use azalea_registry::ParticleKind; +use azalea_world::MinecraftEntityId; use bevy_ecs::component::Component; // the order of this enum must be kept in sync with ParticleKind, otherwise @@ -290,15 +291,27 @@ pub struct ItemParticle { #[derive(Debug, Clone, AzBuf, Default)] pub struct VibrationParticle { - pub origin: BlockPos, - pub position_type: String, - pub block_position: BlockPos, - #[var] - pub entity_id: u32, + pub position: PositionSource, #[var] pub ticks: u32, } +#[derive(Debug, Clone, AzBuf)] +pub enum PositionSource { + Block(BlockPos), + Entity { + #[var] + id: MinecraftEntityId, + y_offset: f32, + }, +} +impl Default for PositionSource { + fn default() -> Self { + // bad default but hopefully it never gets used anyways + Self::Block(BlockPos::default()) + } +} + #[derive(Debug, Clone, AzBuf, Default)] pub struct SculkChargeParticle { pub roll: f32, -- cgit v1.2.3