1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Add set_name(), set_count(), set_wear() and set_metadata() to Lua ItemStack

This commit is contained in:
PilzAdam 2013-09-28 22:47:09 +02:00
parent 731392866f
commit a9c0961e0c
3 changed files with 79 additions and 0 deletions

View file

@ -1658,9 +1658,13 @@ ItemStack: A stack of items.
methods:
- is_empty(): return true if stack is empty
- get_name(): returns item name (e.g. "default:stone")
- set_name(itemname)
- get_count(): returns number of items on the stack
- set_count(count)
- get_wear(): returns tool wear (0-65535), 0 for non-tools
- set_wear(wear)
- get_metadata(): returns metadata (a string attached to an item stack)
- set_metadata(metadata)
- clear(): removes all items from the stack, making it empty
- replace(item): replace the contents of this stack (item can also
be an itemstring or table)