From 5ea127114582e3320381d09e880f6a433ccb8710 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 6 Jan 2024 18:16:11 -0600 Subject: add doc comment about d= --- azalea-inventory/src/slot.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'azalea-inventory/src') 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`] -- cgit v1.2.3