summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbas080 <bas080@hotmail.com>2013-04-07 11:30:11 +0200
committerbas080 <bas080@hotmail.com>2013-04-07 11:30:11 +0200
commit7b561ab4236a5f609578a93a5733fdf303a555ba (patch)
tree9b74da6755085a69a38f84ce920836e6b8509606
parente271dc0818ee61e59427f29faf3990db88ba497d (diff)
downloadpipeworks-7b561ab4236a5f609578a93a5733fdf303a555ba.tar
pipeworks-7b561ab4236a5f609578a93a5733fdf303a555ba.tar.gz
pipeworks-7b561ab4236a5f609578a93a5733fdf303a555ba.tar.bz2
pipeworks-7b561ab4236a5f609578a93a5733fdf303a555ba.tar.xz
pipeworks-7b561ab4236a5f609578a93a5733fdf303a555ba.zip
Autocrafter only crafts when destination inventory has space
-rw-r--r--autocrafter.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/autocrafter.lua b/autocrafter.lua
index ba62c79..a28faec 100644
--- a/autocrafter.lua
+++ b/autocrafter.lua
@@ -11,6 +11,7 @@ function autocraft(inventory)
local input=inventory:get_list("input")
if result.item:is_empty() then return end
result=result.item
+ if not inventory:room_for_item("dst", result) then return end
local to_use={}
for _,item in ipairs(recipe) do
if item~=nil and not item:is_empty() then
@@ -77,4 +78,4 @@ minetest.register_abm({nodenames={"pipeworks:autocrafter"},interval=1,chance=1,
local meta=minetest.env:get_meta(pos)
local inv=meta:get_inventory()
autocraft(inv)
- end}) \ No newline at end of file
+ end})