mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
LuaItemStack: Add __tostring metamethod (#8785)
* LuaItemStack: Add __tostring metamethod * Clean up LuaItemStack::checkobject
This commit is contained in:
parent
09e285f38c
commit
b16f841756
5 changed files with 41 additions and 22 deletions
|
@ -40,13 +40,13 @@ struct ItemStack
|
|||
~ItemStack() = default;
|
||||
|
||||
// Serialization
|
||||
void serialize(std::ostream &os) const;
|
||||
void serialize(std::ostream &os, bool serialize_meta = true) const;
|
||||
// Deserialization. Pass itemdef unless you don't want aliases resolved.
|
||||
void deSerialize(std::istream &is, IItemDefManager *itemdef = NULL);
|
||||
void deSerialize(const std::string &s, IItemDefManager *itemdef = NULL);
|
||||
|
||||
// Returns the string used for inventory
|
||||
std::string getItemString() const;
|
||||
std::string getItemString(bool include_meta = true) const;
|
||||
// Returns the tooltip
|
||||
std::string getDescription(IItemDefManager *itemdef) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue