aboutsummaryrefslogtreecommitdiff
path: root/azalea-inventory/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-01-06 18:16:11 -0600
committermat <git@matdoes.dev>2024-01-06 18:16:11 -0600
commit5ea127114582e3320381d09e880f6a433ccb8710 (patch)
tree0a6f56ecf94260334a11ce81b532226346cb86ba /azalea-inventory/src
parent1347f3549282397be6a46b8b7cb76a7900d0690a (diff)
downloadazalea-drasl-5ea127114582e3320381d09e880f6a433ccb8710.tar.xz
add doc comment about d=
Diffstat (limited to 'azalea-inventory/src')
-rw-r--r--azalea-inventory/src/slot.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/azalea-inventory/src/slot.rs b/azalea-inventory/src/slot.rs
index 814b6c37..c4f8da05 100644
--- a/azalea-inventory/src/slot.rs
+++ b/azalea-inventory/src/slot.rs
@@ -71,6 +71,14 @@ impl ItemSlot {
}
}
}
+
+ /// Convert this slot into an [`ItemSlotData`], if it's present.
+ pub fn as_present(&self) -> Option<&ItemSlotData> {
+ match self {
+ ItemSlot::Empty => None,
+ ItemSlot::Present(i) => Some(i),
+ }
+ }
}
/// An item in an inventory, with a count and NBT. Usually you want [`ItemSlot`]