diff options
| author | mat <git@matdoes.dev> | 2025-01-29 02:00:44 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-01-29 02:02:39 +0000 |
| commit | ef25e77e5262c68c682d889bc58e7120c66f978a (patch) | |
| tree | 1810cbbd0440b22ee7cabfd9fffb8454a3cc848b /azalea-entity/src | |
| parent | 67c053638cd4f0922f47ae24036c9b868db96e51 (diff) | |
| download | azalea-drasl-ef25e77e5262c68c682d889bc58e7120c66f978a.tar.xz | |
add data for EntityEffect particle to fix set_entity_data errors on hypixel
Diffstat (limited to 'azalea-entity/src')
| -rwxr-xr-x | azalea-entity/src/particle.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/azalea-entity/src/particle.rs b/azalea-entity/src/particle.rs index a8710eff..497f4cef 100755 --- a/azalea-entity/src/particle.rs +++ b/azalea-entity/src/particle.rs @@ -8,7 +8,7 @@ use bevy_ecs::component::Component; // the order of this enum must be kept in sync with ParticleKind, otherwise // we get errors parsing particles. /// A [`ParticleKind`] with data potentially attached to it. -#[derive(Component, Clone, Debug, AzBuf, Default)] +#[derive(Component, Clone, Debug, AzBuf)] pub enum Particle { AngryVillager, Block(BlockParticle), @@ -30,8 +30,7 @@ pub enum Particle { EnchantedHit, Enchant, EndRod, - #[default] - EntityEffect, + EntityEffect(ColorParticle), ExplosionEmitter, Explosion, Gust, @@ -154,7 +153,7 @@ impl From<ParticleKind> for Particle { ParticleKind::EnchantedHit => Self::EnchantedHit, ParticleKind::Enchant => Self::Enchant, ParticleKind::EndRod => Self::EndRod, - ParticleKind::EntityEffect => Self::EntityEffect, + ParticleKind::EntityEffect => Self::EntityEffect(ColorParticle::default()), ParticleKind::ExplosionEmitter => Self::ExplosionEmitter, ParticleKind::Explosion => Self::Explosion, ParticleKind::Gust => Self::Gust, @@ -250,6 +249,12 @@ impl From<ParticleKind> for Particle { } } +impl Default for Particle { + fn default() -> Self { + Self::EntityEffect(ColorParticle::default()) + } +} + #[derive(Debug, Clone, AzBuf, Default)] pub struct BlockParticle { pub block_state: BlockState, @@ -270,6 +275,11 @@ pub struct DustColorTransitionParticle { } #[derive(Debug, Clone, AzBuf, Default)] +pub struct ColorParticle { + pub color: RgbColor, +} + +#[derive(Debug, Clone, AzBuf, Default)] pub struct ItemParticle { pub item: ItemStack, } |
