forked from mtcontrib/pipeworks
Try to fix #67
This commit is contained in:
parent
476a60b848
commit
eeff32781c
@ -357,6 +357,7 @@ if pipeworks.enable_detector_tube then
|
|||||||
local detector_plain_textures = {"pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png",
|
local detector_plain_textures = {"pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png",
|
||||||
"pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png"}
|
"pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png", "pipeworks_detector_tube_plain.png"}
|
||||||
local detector_inv_texture = "pipeworks_detector_tube_inv.png"
|
local detector_inv_texture = "pipeworks_detector_tube_inv.png"
|
||||||
|
local detector_tube_step = 2 * tonumber(minetest.setting_get("dedicated_server_step"))
|
||||||
pipeworks.register_tube("pipeworks:detector_tube_on", "Detector tube segment on (you hacker you)", detector_plain_textures, noctr_textures,
|
pipeworks.register_tube("pipeworks:detector_tube_on", "Detector tube segment on (you hacker you)", detector_plain_textures, noctr_textures,
|
||||||
end_textures, short_texture, detector_inv_texture,
|
end_textures, short_texture, detector_inv_texture,
|
||||||
{tube = {can_go = function(pos, node, velocity, stack)
|
{tube = {can_go = function(pos, node, velocity, stack)
|
||||||
@ -364,7 +365,7 @@ if pipeworks.enable_detector_tube then
|
|||||||
local name = minetest.get_node(pos).name
|
local name = minetest.get_node(pos).name
|
||||||
local nitems = meta:get_int("nitems")+1
|
local nitems = meta:get_int("nitems")+1
|
||||||
meta:set_int("nitems", nitems)
|
meta:set_int("nitems", nitems)
|
||||||
minetest.after(0.1, minetest.registered_nodes[name].item_exit, pos)
|
minetest.after(detector_tube_step, minetest.registered_nodes[name].item_exit, pos)
|
||||||
return pipeworks.notvel(pipeworks.meseadjlist,velocity)
|
return pipeworks.notvel(pipeworks.meseadjlist,velocity)
|
||||||
end},
|
end},
|
||||||
groups = {mesecon = 2, not_in_creative_inventory = 1},
|
groups = {mesecon = 2, not_in_creative_inventory = 1},
|
||||||
@ -388,7 +389,7 @@ if pipeworks.enable_detector_tube then
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_int("nitems", 1)
|
meta:set_int("nitems", 1)
|
||||||
local name = minetest.get_node(pos).name
|
local name = minetest.get_node(pos).name
|
||||||
minetest.after(0.1, minetest.registered_nodes[name].item_exit,pos)
|
minetest.after(detector_tube_step, minetest.registered_nodes[name].item_exit,pos)
|
||||||
end})
|
end})
|
||||||
pipeworks.register_tube("pipeworks:detector_tube_off", "Detector tube segment", detector_plain_textures, noctr_textures,
|
pipeworks.register_tube("pipeworks:detector_tube_off", "Detector tube segment", detector_plain_textures, noctr_textures,
|
||||||
end_textures, short_texture, detector_inv_texture,
|
end_textures, short_texture, detector_inv_texture,
|
||||||
|
Loading…
Reference in New Issue
Block a user