diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-08-10 18:55:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-10 18:55:23 -0500 |
| commit | 7120842f9d2c659a2f12d8922299c2a761bc5582 (patch) | |
| tree | 0d7976ceec82d914e4c75f23adcdd5839f9960a4 /azalea-inventory/src/item | |
| parent | 3b659833c1ad4cca89b4cd553193edcb6d223163 (diff) | |
| download | azalea-drasl-7120842f9d2c659a2f12d8922299c2a761bc5582.tar.xz | |
Send correct data component checksums (#234)
* start implementing data component crc32 hashes
* start doing serde impls for checksums
* make more components hashable
* make all data components serializable
* support recursive components
* fix simdnbt dep
* update changelog
* clippy
Diffstat (limited to 'azalea-inventory/src/item')
| -rw-r--r-- | azalea-inventory/src/item/consume_effect.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/azalea-inventory/src/item/consume_effect.rs b/azalea-inventory/src/item/consume_effect.rs index b9540955..8aab42b8 100644 --- a/azalea-inventory/src/item/consume_effect.rs +++ b/azalea-inventory/src/item/consume_effect.rs @@ -1,20 +1,26 @@ use azalea_buf::AzBuf; -use azalea_core::resource_location::ResourceLocation; +use azalea_core::{codec_utils::is_default, resource_location::ResourceLocation}; use azalea_registry::{HolderSet, MobEffect, SoundEvent}; +use serde::Serialize; use crate::components::MobEffectInstance; -#[derive(Clone, PartialEq, AzBuf)] +#[derive(Clone, PartialEq, Debug, AzBuf, Serialize)] +#[serde(rename_all = "snake_case", tag = "type")] pub enum ConsumeEffect { ApplyEffects { + #[serde(skip_serializing_if = "is_default")] effects: Vec<MobEffectInstance>, + #[serde(skip_serializing_if = "is_default")] probability: f32, }, RemoveEffects { + #[serde(skip_serializing_if = "is_default")] effects: HolderSet<MobEffect, ResourceLocation>, }, ClearAllEffects, TeleportRandomly { + #[serde(skip_serializing_if = "is_default")] diameter: f32, }, PlaySound { |
