aboutsummaryrefslogtreecommitdiff
path: root/azalea-inventory/src/default_components/mod.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2025-12-12 00:56:02 -0600
committerGitHub <noreply@github.com>2025-12-12 00:56:02 -0600
commitf9c25665c203d6377ace62f1e95381d037d8fd9e (patch)
tree8b4131d20fe661d3cc1175ec27f801fe61df41ea /azalea-inventory/src/default_components/mod.rs
parent82ad975242292d5875780b4398b62637674bf50a (diff)
downloadazalea-drasl-f9c25665c203d6377ace62f1e95381d037d8fd9e.tar.xz
Refactor azalea-registry (#294)
* move registries in azalea-registry into separate modules * rename Item and Block to ItemKind and BlockKind * remove 'extra' registries from azalea-registry * hide deprecated items from docs * use DamageKindKey instead of Identifier when parsing registries * store tag entries as a Vec instead of a HashSet * sort tag values by protocol id * update changelog
Diffstat (limited to 'azalea-inventory/src/default_components/mod.rs')
-rw-r--r--azalea-inventory/src/default_components/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea-inventory/src/default_components/mod.rs b/azalea-inventory/src/default_components/mod.rs
index 74b7248e..2cc96d51 100644
--- a/azalea-inventory/src/default_components/mod.rs
+++ b/azalea-inventory/src/default_components/mod.rs
@@ -1,21 +1,21 @@
pub mod generated;
-use azalea_registry::Item;
+use azalea_registry::builtin::ItemKind;
use crate::components::DataComponentTrait;
-/// A trait for data components that some [`Item`]s may have a default value
+/// A trait for data components that some [`ItemKind`]s may have a default value
/// for.
pub trait DefaultableComponent: DataComponentTrait {
- fn default_for_item(item: Item) -> Option<Self>
+ fn default_for_item(item: ItemKind) -> Option<Self>
where
Self: Sized;
}
impl<T: DataComponentTrait> DefaultableComponent for T {
- default fn default_for_item(_item: Item) -> Option<Self> {
+ default fn default_for_item(_item: ItemKind) -> Option<Self> {
None
}
}
-pub fn get_default_component<T: DefaultableComponent>(item: Item) -> Option<T> {
+pub fn get_default_component<T: DefaultableComponent>(item: ItemKind) -> Option<T> {
T::default_for_item(item)
}