aboutsummaryrefslogtreecommitdiff
path: root/data/mods/default
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-12-06 18:59:52 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-01-02 02:59:14 +0200
commite48ccd79430db7c9e25209fdff51f8f36e20f202 (patch)
tree337117a8e98c83946bf26b35d05ac988523b8f10 /data/mods/default
parent6be5441176a14137b92f03d9d519234ebee28f6c (diff)
downloadminetest-e48ccd79430db7c9e25209fdff51f8f36e20f202.tar.gz
minetest-e48ccd79430db7c9e25209fdff51f8f36e20f202.tar.bz2
minetest-e48ccd79430db7c9e25209fdff51f8f36e20f202.zip
Add ObjectRef:get_inventory() and add stuff to documentation comments
Diffstat (limited to 'data/mods/default')
-rw-r--r--data/mods/default/init.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua
index abbeab5d5..2b92aef5a 100644
--- a/data/mods/default/init.lua
+++ b/data/mods/default/init.lua
@@ -110,7 +110,10 @@
-- minetest.chat_send_all(text)
-- minetest.chat_send_player(name, text)
-- minetest.get_player_privs(name) -> set of privs
+-- minetest.get_inventory(location) -> InvRef
-- minetest.get_modpath(modname) -> eg. "/home/user/.minetest/usermods/modname"
+-- ^ location = eg. {type="player", name="celeron55"}
+-- {type="node", pos={x=, y=, z=}}
--
-- stackstring_take_item(stackstring) -> stackstring, item
-- stackstring_put_item(stackstring, item) -> stackstring, success
@@ -207,7 +210,23 @@
-- - inventory_get_list(name) -> {item1, item2, ...}
-- - get_look_dir(): get camera direction as a unit vector
-- - get_look_pitch(): pitch in radians
+--
-- - get_look_yaw(): yaw in radians (wraps around pretty randomly as of now)
+-- InvRef
+-- - get_size(listname): get size of a list
+-- - set_size(listname, size): set size of a list
+-- - get_stack(listname, i): get a copy of stack index i in list
+-- - set_stack(listname, i, stack): copy stack to index i in list
+-- - get_list(listname): return full list
+-- - set_list(listname, list): set full list (size will not change)
+-- - autoinsert_stack(listname, stack): insert stack somewhere in list
+-- - autoinsert_stackstring(listname, stackstring)
+--
+-- ItemStack
+-- - peek_item(): return item from stack without removing it
+-- - take_item(): remove item from stack and return it
+-- - put_item(): put item in stack; return false if not possible
+-- - put_stackstring(): put stackstring in stack; return false if not possible
--
-- Registered entities:
-- - Functions receive a "luaentity" as self: