VirtualInventory#getItems

This commit is contained in:
NichtStudioCode 2021-04-10 12:45:53 +02:00
parent ce147a38b8
commit ba0a57af41

@ -74,6 +74,15 @@ public class VirtualInventory implements ConfigurationSerializable {
return size; return size;
} }
/**
* Gets a deep copy of the {@link ItemStack}s in this {@link VirtualInventory}
*
* @return A copy of the {@link ItemStack}s in this {@link VirtualInventory}
*/
public ItemStack[] getItems() {
return Arrays.stream(items).map(ItemStack::clone).toArray(ItemStack[]::new);
}
/** /**
* Changes the size of this {@link VirtualInventory}, removing * Changes the size of this {@link VirtualInventory}, removing
* existing {@link ItemStack}s reduced. * existing {@link ItemStack}s reduced.