return values can be zero or false

This commit is contained in:
auouymous 2018-10-05 17:38:20 -06:00
parent a677f9709a
commit f475371ac4

View File

@ -50,8 +50,8 @@ end
-- query API
-- can_* functions should always be called first and return false if ndef isn't found (unknown node)
-- the other functions can safely skip the ndef check for performance
-- can_* functions should always be called first and return 0 or false if ndef isn't found (unknown node)
-- the other functions skip the ndef check for performance
node_io.can_put_item = function(pos, node, side, itemstack, count) -- returns non-negative number
local ndef = minetest.registered_nodes[node.name]
@ -115,6 +115,7 @@ node_io.get_liquid_stack = function(pos, node, side, index) -- returns itemstack
end
-- access API
node_io.put_item = function(pos, node, side, putter, itemstack) -- returns itemstack with leftovers or a cleared itemstack
@ -141,7 +142,6 @@ end
-- functions for mods with inventories to implement API
node_io.get_inventory = function(pos)