diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-08-04 20:43:10 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-04 20:43:10 -0500 |
| commit | 23b7f20a0d88b54d430820baeb4a6da0316a009a (patch) | |
| tree | f3e780515b3bbb9973d2b94338be6194b5ec0af3 /azalea-inventory/src/item | |
| parent | 827d943c3f27c65724ff83689b40c87d1cd1838c (diff) | |
| download | azalea-drasl-23b7f20a0d88b54d430820baeb4a6da0316a009a.tar.xz | |
Default components (#232)
* add default components
* remove debug prints
* clippy
* use default components
* fix tests
Diffstat (limited to 'azalea-inventory/src/item')
| -rw-r--r-- | azalea-inventory/src/item/consume_effect.rs | 4 | ||||
| -rw-r--r-- | azalea-inventory/src/item/mod.rs | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/azalea-inventory/src/item/consume_effect.rs b/azalea-inventory/src/item/consume_effect.rs index 898f64ff..b9540955 100644 --- a/azalea-inventory/src/item/consume_effect.rs +++ b/azalea-inventory/src/item/consume_effect.rs @@ -10,7 +10,9 @@ pub enum ConsumeEffect { effects: Vec<MobEffectInstance>, probability: f32, }, - RemoveEffects(HolderSet<MobEffect, ResourceLocation>), + RemoveEffects { + effects: HolderSet<MobEffect, ResourceLocation>, + }, ClearAllEffects, TeleportRandomly { diameter: f32, diff --git a/azalea-inventory/src/item/mod.rs b/azalea-inventory/src/item/mod.rs index bbff2d50..0e9947e2 100644 --- a/azalea-inventory/src/item/mod.rs +++ b/azalea-inventory/src/item/mod.rs @@ -1,3 +1,5 @@ +use crate::{components::MaxStackSize, default_components::get_default_component}; + pub mod consume_effect; pub trait MaxStackSizeExt { @@ -19,7 +21,6 @@ pub trait MaxStackSizeExt { impl MaxStackSizeExt for azalea_registry::Item { fn max_stack_size(&self) -> i32 { - // TODO: have the properties for every item defined somewhere - 64 + get_default_component::<MaxStackSize>(*self).map_or(64, |s| s.count) } } |
