aboutsummaryrefslogtreecommitdiff
path: root/azalea-inventory
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-11-28 03:22:34 +0000
committermat <git@matdoes.dev>2024-11-28 03:22:34 +0000
commitae5c0ea8e5e1ac9571b78281c26b7d63d110f5e5 (patch)
tree6bf3e68f7d2068af64521c213ad1dcd39eb1b7df /azalea-inventory
parentc36201cc894bcc99a06358eea31d210800980dae (diff)
downloadazalea-drasl-ae5c0ea8e5e1ac9571b78281c26b7d63d110f5e5.tar.xz
improve DataComponentPatch::has and has_kind
Diffstat (limited to 'azalea-inventory')
-rw-r--r--azalea-inventory/src/slot.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/azalea-inventory/src/slot.rs b/azalea-inventory/src/slot.rs
index 19963b34..757dc92d 100644
--- a/azalea-inventory/src/slot.rs
+++ b/azalea-inventory/src/slot.rs
@@ -217,11 +217,11 @@ impl DataComponentPatch {
/// # assert!(!is_edible);
/// ```
pub fn has<T: components::DataComponent>(&self) -> bool {
- self.components.contains_key(&T::KIND)
+ self.has_kind(T::KIND)
}
pub fn has_kind(&self, kind: DataComponentKind) -> bool {
- self.components.contains_key(&kind)
+ self.get_kind(kind).is_some()
}
}