aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src/particle.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2024-04-23 10:34:50 -0500
committerGitHub <noreply@github.com>2024-04-23 10:34:50 -0500
commit1d80f531b74bc3b31023753acb81b35efcdadd73 (patch)
tree675635c7c41fbb456e3e0dd7b9f09c7211d356f0 /azalea-core/src/particle.rs
parent0ddad8bd9c7c0e8846aec8bc90c95416418c9a63 (diff)
downloadazalea-drasl-1d80f531b74bc3b31023753acb81b35efcdadd73.tar.xz
1.20.5 (#127)
* 23w51b * make recalculate_near_end_of_path public so other plugins can do .after(recalculate_near_end_of_path) * update to 24w03a i think * start implementing 24w13a * registries work (but a lot of packets are still broken) * fix recipes and commands packets * i love codecs :D i am not going insane :D mojang's java is very readable :D * item components are "implemented" meowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeow * update to 1.20.5-pre3 * fix all the broken packets and clippy (mojang please don't do an update like this again or i will murder someone) * 1.20.5-rc1 * fix failing tests * 1.20.5
Diffstat (limited to 'azalea-core/src/particle.rs')
-rwxr-xr-xazalea-core/src/particle.rs294
1 files changed, 0 insertions, 294 deletions
diff --git a/azalea-core/src/particle.rs b/azalea-core/src/particle.rs
deleted file mode 100755
index 4137d867..00000000
--- a/azalea-core/src/particle.rs
+++ /dev/null
@@ -1,294 +0,0 @@
-use crate::position::BlockPos;
-use azalea_buf::McBuf;
-use azalea_inventory::ItemSlot;
-use azalea_registry::ParticleKind;
-
-#[cfg_attr(feature = "bevy_ecs", derive(bevy_ecs::component::Component))]
-#[derive(Debug, Clone, McBuf, Default)]
-pub struct Particle {
- #[var]
- pub id: i32,
- pub data: ParticleData,
-}
-
-#[derive(Clone, Debug, McBuf, Default)]
-pub enum ParticleData {
- AmbientEntityEffect,
- AngryVillager,
- Block(BlockParticle),
- BlockMarker(BlockParticle),
- Bubble,
- Cloud,
- Crit,
- DamageIndicator,
- DragonBreath,
- DrippingLava,
- FallingLava,
- LandingLava,
- DrippingWater,
- FallingWater,
- Dust(DustParticle),
- DustColorTransition(DustColorTransitionParticle),
- Effect,
- ElderGuardian,
- EnchantedHit,
- Enchant,
- EndRod,
- #[default]
- EntityEffect,
- ExplosionEmitter,
- Explosion,
- Gust,
- GustEmitter,
- SonicBoom,
- FallingDust(BlockParticle),
- Firework,
- Fishing,
- Flame,
- CherryLeaves,
- SculkSoul,
- SculkCharge(SculkChargeParticle),
- SculkChargePop,
- SoulFireFlame,
- Soul,
- Flash,
- HappyVillager,
- Composter,
- Heart,
- InstantEffect,
- Item(ItemParticle),
- Vibration(VibrationParticle),
- ItemSlime,
- ItemSnowball,
- LargeSmoke,
- Lava,
- Mycelium,
- Note,
- Poof,
- Portal,
- Rain,
- Smoke,
- WhiteSmoke,
- Sneeze,
- Spit,
- SquidInk,
- SweepAttack,
- TotemOfUndying,
- Underwater,
- Splash,
- Witch,
- BubblePop,
- CurrentDown,
- BubbleColumnUp,
- Nautilus,
- Dolphin,
- CampfireCozySmoke,
- CampfireSignalSmoke,
- DrippingHoney,
- FallingHoney,
- LandingHoney,
- FallingNectar,
- FallingSporeBlossom,
- Ash,
- CrimsonSpore,
- WarpedSpore,
- SporeBlossomAir,
- DrippingObsidianTear,
- FallingObsidianTear,
- LandingObsidianTear,
- ReversePortal,
- WhiteAsh,
- SmallFlame,
- Snowflake,
- DrippingDripstoneLava,
- FallingDripstoneLava,
- DrippingDripstoneWater,
- FallingDripstoneWater,
- GlowSquidInk,
- Glow,
- WaxOn,
- WaxOff,
- ElectricSpark,
- Scrape,
- Shriek(ShriekParticle),
- EggCrack,
- DustPlume,
- GustDust,
- TrialSpawnerDetection,
-}
-
-impl From<ParticleKind> for ParticleData {
- /// 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 {
- // this is mostly just here so it fails to compile when a new particle is added
- // to ParticleKind, since ParticleData has to be updated manually
- match kind {
- ParticleKind::AmbientEntityEffect => Self::AmbientEntityEffect,
- ParticleKind::AngryVillager => Self::AngryVillager,
- ParticleKind::Block => Self::Block(BlockParticle::default()),
- ParticleKind::BlockMarker => Self::BlockMarker(BlockParticle::default()),
- ParticleKind::Bubble => Self::Bubble,
- ParticleKind::Cloud => Self::Cloud,
- ParticleKind::Crit => Self::Crit,
- ParticleKind::DamageIndicator => Self::DamageIndicator,
- ParticleKind::DragonBreath => Self::DragonBreath,
- ParticleKind::DrippingLava => Self::DrippingLava,
- ParticleKind::FallingLava => Self::FallingLava,
- ParticleKind::LandingLava => Self::LandingLava,
- ParticleKind::DrippingWater => Self::DrippingWater,
- ParticleKind::FallingWater => Self::FallingWater,
- ParticleKind::Dust => Self::Dust(DustParticle::default()),
- ParticleKind::DustColorTransition => {
- Self::DustColorTransition(DustColorTransitionParticle::default())
- }
- ParticleKind::Effect => Self::Effect,
- ParticleKind::ElderGuardian => Self::ElderGuardian,
- ParticleKind::EnchantedHit => Self::EnchantedHit,
- ParticleKind::Enchant => Self::Enchant,
- ParticleKind::EndRod => Self::EndRod,
- ParticleKind::EntityEffect => Self::EntityEffect,
- ParticleKind::ExplosionEmitter => Self::ExplosionEmitter,
- ParticleKind::Explosion => Self::Explosion,
- ParticleKind::Gust => Self::Gust,
- ParticleKind::GustEmitter => Self::GustEmitter,
- ParticleKind::SonicBoom => Self::SonicBoom,
- ParticleKind::FallingDust => Self::FallingDust(BlockParticle::default()),
- ParticleKind::Firework => Self::Firework,
- ParticleKind::Fishing => Self::Fishing,
- ParticleKind::Flame => Self::Flame,
- ParticleKind::CherryLeaves => Self::CherryLeaves,
- ParticleKind::SculkSoul => Self::SculkSoul,
- ParticleKind::SculkCharge => Self::SculkCharge(SculkChargeParticle::default()),
- ParticleKind::SculkChargePop => Self::SculkChargePop,
- ParticleKind::SoulFireFlame => Self::SoulFireFlame,
- ParticleKind::Soul => Self::Soul,
- ParticleKind::Flash => Self::Flash,
- ParticleKind::HappyVillager => Self::HappyVillager,
- ParticleKind::Composter => Self::Composter,
- ParticleKind::Heart => Self::Heart,
- ParticleKind::InstantEffect => Self::InstantEffect,
- ParticleKind::Item => Self::Item(ItemParticle::default()),
- ParticleKind::Vibration => Self::Vibration(VibrationParticle::default()),
- ParticleKind::ItemSlime => Self::ItemSlime,
- ParticleKind::ItemSnowball => Self::ItemSnowball,
- ParticleKind::LargeSmoke => Self::LargeSmoke,
- ParticleKind::Lava => Self::Lava,
- ParticleKind::Mycelium => Self::Mycelium,
- ParticleKind::Note => Self::Note,
- ParticleKind::Poof => Self::Poof,
- ParticleKind::Portal => Self::Portal,
- ParticleKind::Rain => Self::Rain,
- ParticleKind::Smoke => Self::Smoke,
- ParticleKind::WhiteSmoke => Self::WhiteSmoke,
- ParticleKind::Sneeze => Self::Sneeze,
- ParticleKind::Spit => Self::Spit,
- ParticleKind::SquidInk => Self::SquidInk,
- ParticleKind::SweepAttack => Self::SweepAttack,
- ParticleKind::TotemOfUndying => Self::TotemOfUndying,
- ParticleKind::Underwater => Self::Underwater,
- ParticleKind::Splash => Self::Splash,
- ParticleKind::Witch => Self::Witch,
- ParticleKind::BubblePop => Self::BubblePop,
- ParticleKind::CurrentDown => Self::CurrentDown,
- ParticleKind::BubbleColumnUp => Self::BubbleColumnUp,
- ParticleKind::Nautilus => Self::Nautilus,
- ParticleKind::Dolphin => Self::Dolphin,
- ParticleKind::CampfireCosySmoke => Self::CampfireCozySmoke,
- ParticleKind::CampfireSignalSmoke => Self::CampfireSignalSmoke,
- ParticleKind::DrippingHoney => Self::DrippingHoney,
- ParticleKind::FallingHoney => Self::FallingHoney,
- ParticleKind::LandingHoney => Self::LandingHoney,
- ParticleKind::FallingNectar => Self::FallingNectar,
- ParticleKind::FallingSporeBlossom => Self::FallingSporeBlossom,
- ParticleKind::Ash => Self::Ash,
- ParticleKind::CrimsonSpore => Self::CrimsonSpore,
- ParticleKind::WarpedSpore => Self::WarpedSpore,
- ParticleKind::SporeBlossomAir => Self::SporeBlossomAir,
- ParticleKind::DrippingObsidianTear => Self::DrippingObsidianTear,
- ParticleKind::FallingObsidianTear => Self::FallingObsidianTear,
- ParticleKind::LandingObsidianTear => Self::LandingObsidianTear,
- ParticleKind::ReversePortal => Self::ReversePortal,
- ParticleKind::WhiteAsh => Self::WhiteAsh,
- ParticleKind::SmallFlame => Self::SmallFlame,
- ParticleKind::Snowflake => Self::Snowflake,
- ParticleKind::DrippingDripstoneLava => Self::DrippingDripstoneLava,
- ParticleKind::FallingDripstoneLava => Self::FallingDripstoneLava,
- ParticleKind::DrippingDripstoneWater => Self::DrippingDripstoneWater,
- ParticleKind::FallingDripstoneWater => Self::FallingDripstoneWater,
- ParticleKind::GlowSquidInk => Self::GlowSquidInk,
- ParticleKind::Glow => Self::Glow,
- ParticleKind::WaxOn => Self::WaxOn,
- ParticleKind::WaxOff => Self::WaxOff,
- ParticleKind::ElectricSpark => Self::ElectricSpark,
- ParticleKind::Scrape => Self::Scrape,
- ParticleKind::Shriek => Self::Shriek(ShriekParticle::default()),
- ParticleKind::EggCrack => Self::EggCrack,
- ParticleKind::DustPlume => Self::DustPlume,
- ParticleKind::GustDust => Self::GustDust,
- ParticleKind::TrialSpawnerDetection => Self::TrialSpawnerDetection,
- }
- }
-}
-
-#[derive(Debug, Clone, McBuf, Default)]
-pub struct BlockParticle {
- #[var]
- pub block_state: i32,
-}
-#[derive(Debug, Clone, McBuf, Default)]
-pub struct DustParticle {
- /// Red value, 0-1
- pub red: f32,
- /// Green value, 0-1
- pub green: f32,
- /// Blue value, 0-1
- pub blue: f32,
- /// The scale, will be clamped between 0.01 and 4.
- pub scale: f32,
-}
-
-#[derive(Debug, Clone, McBuf, Default)]
-pub struct DustColorTransitionParticle {
- /// Red value, 0-1
- pub from_red: f32,
- /// Green value, 0-1
- pub from_green: f32,
- /// Blue value, 0-1
- pub from_blue: f32,
- /// The scale, will be clamped between 0.01 and 4.
- pub scale: f32,
- /// Red value, 0-1
- pub to_red: f32,
- /// Green value, 0-1
- pub to_green: f32,
- /// Blue value, 0-1
- pub to_blue: f32,
-}
-
-#[derive(Debug, Clone, McBuf, Default)]
-pub struct ItemParticle {
- pub item: ItemSlot,
-}
-
-#[derive(Debug, Clone, McBuf, Default)]
-pub struct VibrationParticle {
- pub origin: BlockPos,
- pub position_type: String,
- pub block_position: BlockPos,
- #[var]
- pub entity_id: u32,
- #[var]
- pub ticks: u32,
-}
-
-#[derive(Debug, Clone, McBuf, Default)]
-pub struct SculkChargeParticle {
- pub roll: f32,
-}
-
-#[derive(Debug, Clone, McBuf, Default)]
-pub struct ShriekParticle {
- #[var]
- pub delay: i32, // The time in ticks before the particle is displayed
-}