diff options
| author | mat <git@matdoes.dev> | 2024-11-28 03:22:34 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-11-28 03:22:34 +0000 |
| commit | ae5c0ea8e5e1ac9571b78281c26b7d63d110f5e5 (patch) | |
| tree | 6bf3e68f7d2068af64521c213ad1dcd39eb1b7df /azalea-inventory | |
| parent | c36201cc894bcc99a06358eea31d210800980dae (diff) | |
| download | azalea-drasl-ae5c0ea8e5e1ac9571b78281c26b7d63d110f5e5.tar.xz | |
improve DataComponentPatch::has and has_kind
Diffstat (limited to 'azalea-inventory')
| -rw-r--r-- | azalea-inventory/src/slot.rs | 4 |
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() } } |
