diff options
author | Novatux <nathanael.courant@laposte.net> | 2014-08-16 13:42:17 +0200 |
---|---|---|
committer | Novatux <nathanael.courant@laposte.net> | 2014-08-16 13:42:17 +0200 |
commit | 35b10adb401c90d3ca8b69a106e82e1fb43a9f52 (patch) | |
tree | bc7e2ea1835bfbb0c8b3e64dec1cc0a0c7265fdb | |
parent | 849526cd763cb3817f1cb5648da0f0e3d0467ef0 (diff) |
Fix items sending
-rw-r--r-- | technic/machines/other/injector.lua | 11 | ||||
-rw-r--r-- | technic/machines/register/common.lua | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/technic/machines/other/injector.lua b/technic/machines/other/injector.lua index eb63987..36c2592 100644 --- a/technic/machines/other/injector.lua +++ b/technic/machines/other/injector.lua @@ -97,12 +97,11 @@ minetest.register_abm({ interval = 1, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) - local pos1={} - pos1.x = pos.x - pos1.y = pos.y-1 - pos1.z = pos.z - local meta=minetest.env:get_meta(pos1) - if meta:get_int("tubelike")==1 then inject_items (pos) end + local pos1 = vector.add(pos, vector.new(0, -1, 0)) + local node1 = minetest.get_node(pos1) + if minetest.get_item_group(node1.name, "tubedevice") > 0 then + inject_items(pos) + end end, }) diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua index 9e847c4..0e59d0e 100644 --- a/technic/machines/register/common.lua +++ b/technic/machines/register/common.lua @@ -101,8 +101,8 @@ function technic.handle_machine_pipeworks(pos, tube_upgrade, send_function) if node.param2 == 0 then pos1.x = pos1.x + 1 x_velocity = 1 end local output_tube_connected = false - local meta1 = minetest.get_meta(pos1) - if meta1:get_int("tubelike") == 1 then + local node1 = minetest.get_node(pos1) + if minetest.get_item_group(node1.name, "tubedevice") > 0 then output_tube_connected = true end tube_time = meta:get_int("tube_time") |