aboutsummaryrefslogtreecommitdiff
path: root/azalea-inventory/src/components.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-03-13 20:46:12 +0000
committermat <git@matdoes.dev>2025-03-13 20:46:12 +0000
commit65fe07215149ab81d0862ab7edac71d6a8417ef8 (patch)
tree9e06778329cbf9a14f87c93d1a3686f6b91f2b4e /azalea-inventory/src/components.rs
parent7a192acc99358818c2f90cf4e2b8b236f91cfbf7 (diff)
downloadazalea-drasl-65fe07215149ab81d0862ab7edac71d6a8417ef8.tar.xz
fix wrong Consumable component implementation and add set_equipment test
Diffstat (limited to 'azalea-inventory/src/components.rs')
-rw-r--r--azalea-inventory/src/components.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/azalea-inventory/src/components.rs b/azalea-inventory/src/components.rs
index b299664f..2ff00d5b 100644
--- a/azalea-inventory/src/components.rs
+++ b/azalea-inventory/src/components.rs
@@ -5,6 +5,7 @@ use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError};
use azalea_chat::FormattedText;
use azalea_core::{
filterable::Filterable, position::GlobalPos, resource_location::ResourceLocation,
+ sound::CustomSound,
};
use azalea_registry::{
Attribute, Block, ConsumeEffectKind, DataComponentKind, Enchantment, EntityKind, HolderSet,
@@ -14,7 +15,7 @@ use simdnbt::owned::{Nbt, NbtCompound};
use tracing::trace;
use uuid::Uuid;
-use crate::ItemStack;
+use crate::{ItemStack, item::consume_effect::ConsumeEffect};
pub trait DataComponent: Send + Sync + Any {
const KIND: DataComponentKind;
@@ -800,9 +801,9 @@ impl DataComponent for JukeboxPlayable {
pub struct Consumable {
pub consume_seconds: f32,
pub animation: ItemUseAnimation,
- pub sound: SoundEvent,
+ pub sound: azalea_registry::Holder<SoundEvent, CustomSound>,
pub has_consume_particles: bool,
- pub on_consuime_effects: Vec<ConsumeEffectKind>,
+ pub on_consume_effects: Vec<ConsumeEffect>,
}
impl DataComponent for Consumable {
const KIND: DataComponentKind = DataComponentKind::Consumable;