From f475371ac41f6228f3e732fe7d15bfd715b7c24b Mon Sep 17 00:00:00 2001 From: auouymous Date: Fri, 5 Oct 2018 17:38:20 -0600 Subject: [PATCH] return values can be zero or false --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 066f373..524c448 100644 --- a/init.lua +++ b/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)