diff options
| author | mat <git@matdoes.dev> | 2024-08-15 01:24:03 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-08-15 01:24:03 +0000 |
| commit | dec544a52ba738e2d0e2c3a042e5ccc0cb336ffb (patch) | |
| tree | 87a1103b3cbd43342fa7c699247313ed826f8be7 /azalea-entity | |
| parent | 13afc1d6a42d28f01087fb59ca868696be4a2635 (diff) | |
| download | azalea-drasl-dec544a52ba738e2d0e2c3a042e5ccc0cb336ffb.tar.xz | |
fix ClientboundLevelParticlesPacket errors and pathfinder /particle errors
Diffstat (limited to 'azalea-entity')
| -rwxr-xr-x | azalea-entity/src/particle.rs | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/azalea-entity/src/particle.rs b/azalea-entity/src/particle.rs index 6d8c9fd9..ab8ac5bb 100755 --- a/azalea-entity/src/particle.rs +++ b/azalea-entity/src/particle.rs @@ -4,30 +4,19 @@ use azalea_inventory::ItemSlot; use azalea_registry::ParticleKind; use bevy_ecs::component::Component; -#[derive(Component, Debug, Clone, McBuf, Default)] -pub struct Particle { - #[var] - pub id: i32, - pub data: ParticleData, -} - -#[derive(Clone, Debug, McBuf, Default)] -pub enum ParticleData { +// 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, McBuf, Default)] +pub enum Particle { AngryVillager, - BlockMarker(BlockParticle), Block(BlockParticle), + BlockMarker(BlockParticle), Bubble, - BubbleColumnUp, - BubblePop, - CampfireCosySmoke, - CampfireSignalSmoke, Cloud, - Composter, Crit, - CurrentDown, DamageIndicator, DragonBreath, - Dolphin, DrippingLava, FallingLava, LandingLava, @@ -44,33 +33,35 @@ pub enum ParticleData { EntityEffect, ExplosionEmitter, Explosion, - SonicBoom, - FallingDust(BlockParticle), Gust, SmallGust, GustEmitterLarge, GustEmitterSmall, + SonicBoom, + FallingDust(BlockParticle), Firework, Fishing, Flame, Infested, + CherryLeaves, SculkSoul, SculkCharge(SculkChargeParticle), SculkChargePop, - Soul, SoulFireFlame, + Soul, Flash, HappyVillager, + Composter, Heart, InstantEffect, Item(ItemParticle), + Vibration(VibrationParticle), ItemSlime, ItemCobweb, ItemSnowball, LargeSmoke, Lava, Mycelium, - Nautilus, Note, Poof, Portal, @@ -78,35 +69,40 @@ pub enum ParticleData { Smoke, WhiteSmoke, Sneeze, - Snowflake, Spit, + SquidInk, SweepAttack, TotemOfUndying, - SquidInk, Underwater, Splash, Witch, + BubblePop, + CurrentDown, + BubbleColumnUp, + Nautilus, + Dolphin, + CampfireCosySmoke, + CampfireSignalSmoke, DrippingHoney, FallingHoney, LandingHoney, FallingNectar, FallingSporeBlossom, - SporeBlossomAir, Ash, CrimsonSpore, WarpedSpore, + SporeBlossomAir, DrippingObsidianTear, FallingObsidianTear, LandingObsidianTear, ReversePortal, WhiteAsh, SmallFlame, - DrippingDripstoneWater, - FallingDripstoneWater, - CherryLeaves, + Snowflake, DrippingDripstoneLava, FallingDripstoneLava, - Vibration(VibrationParticle), + DrippingDripstoneWater, + FallingDripstoneWater, GlowSquidInk, Glow, WaxOn, @@ -120,12 +116,12 @@ pub enum ParticleData { TrialSpawnerDetectionOminous, VaultConnection, DustPillar, + OminousSpawning, RaidOmen, TrialOmen, - OminousSpawning, } -impl From<ParticleKind> for ParticleData { +impl From<ParticleKind> for Particle { /// Convert a particle kind into particle data. If the particle has data /// attached (like block particles), then it's set to the default. fn from(kind: ParticleKind) -> Self { |
