+
+ // If possible, adds newitem to this item.
+ // If cannot be added at all, returns the item back.
+ // If can be added partly, decremented item is returned back.
+ // If can be added fully, empty item is returned.
+ ItemStack addItem(const ItemStack &newitem,
+ IItemDefManager *itemdef);
+
+ // Checks whether newitem could be added.
+ // If restitem is non-NULL, it receives the part of newitem that
+ // would be left over after adding.
+ bool itemFits(const ItemStack &newitem,
+ ItemStack *restitem, // may be NULL
+ IItemDefManager *itemdef) const;
+
+ // Takes some items.
+ // If there are not enough, takes as many as it can.
+ // Returns empty item if couldn't take any.
+ ItemStack takeItem(u32 takecount);
+
+ // Similar to takeItem, but keeps this ItemStack intact.
+ ItemStack peekItem(u32 peekcount) const;
+
+ /*
+ Properties
+ */
+ std::string name;
+ u16 count;
+ u16 wear;
+ std::string metadata;