summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-04-12 16:03:41 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-04-12 16:03:41 -0400
commit0c0e6a6b66d09082f56f388da1e252b71a62d44c (patch)
treee68087fef8d80b19266c0d22c0bad6200b3524ea
parent9d6881deca8dc5974fe7a5bc39909bfd7e9c0feb (diff)
downloadpipeworks-0c0e6a6b66d09082f56f388da1e252b71a62d44c.tar
pipeworks-0c0e6a6b66d09082f56f388da1e252b71a62d44c.tar.gz
pipeworks-0c0e6a6b66d09082f56f388da1e252b71a62d44c.tar.bz2
pipeworks-0c0e6a6b66d09082f56f388da1e252b71a62d44c.tar.xz
pipeworks-0c0e6a6b66d09082f56f388da1e252b71a62d44c.zip
make sure there's something appropriate to inject an item into
(fixes #123)
-rw-r--r--filter-injector.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/filter-injector.lua b/filter-injector.lua
index 0d22675..57a07e9 100644
--- a/filter-injector.lua
+++ b/filter-injector.lua
@@ -196,6 +196,21 @@ local function punch_filter(data, filtpos, filtnode, msg)
["technic:tool_workshop"] = "src",
}
+ local todir = pipeworks.facedir_to_right_dir(filtnode.param2)
+ local topos = vector.add(filtpos, todir)
+ local tonode = minetest.get_node(topos)
+ local todef = minetest.registered_nodes[tonode.name]
+
+ print("===================")
+ print(tonode.name)
+ print(minetest.get_item_group(tonode.name, "tube"))
+ print(minetest.get_item_group(tonode.name, "tubedevice_receiver"))
+ if not todef
+ or not (minetest.get_item_group(tonode.name, "tube") == 1
+ or minetest.get_item_group(tonode.name, "tubedevice_receiver") == 1) then
+ return
+ end
+
if fromtube then fromtube.input_inventory = input_special_cases[fromnode.name] or fromtube.input_inventory end
if not (fromtube and fromtube.input_inventory) then return end