return values can be zero or false
This commit is contained in:
parent
a677f9709a
commit
f475371ac4
6
init.lua
6
init.lua
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user