mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
improve DataComponentPatch::has and has_kind
This commit is contained in:
parent
c36201cc89
commit
ae5c0ea8e5
1 changed files with 2 additions and 2 deletions
|
@ -217,11 +217,11 @@ impl DataComponentPatch {
|
||||||
/// # assert!(!is_edible);
|
/// # assert!(!is_edible);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn has<T: components::DataComponent>(&self) -> bool {
|
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 {
|
pub fn has_kind(&self, kind: DataComponentKind) -> bool {
|
||||||
self.components.contains_key(&kind)
|
self.get_kind(kind).is_some()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue