mirror of
https://github.com/joe7575/techpack.git
synced 2024-11-25 16:43:50 +01:00
undo preventing machines from pushing to themselves; make detector only accept items on the input side
This commit is contained in:
parent
ebd9864ce0
commit
281f4b539b
@ -139,7 +139,6 @@ local function get_dest_node(pos, side)
|
|||||||
local dir = side_to_dir(side, node.param2)
|
local dir = side_to_dir(side, node.param2)
|
||||||
local spos, sdir = Tube:get_connected_node_pos(pos, dir)
|
local spos, sdir = Tube:get_connected_node_pos(pos, dir)
|
||||||
if not (spos and sdir) then return end
|
if not (spos and sdir) then return end
|
||||||
if vector.equals(pos, spos) then return end
|
|
||||||
_,node = Tube:get_node(spos)
|
_,node = Tube:get_node(spos)
|
||||||
local out_side = dir_to_side(tubelib2.Turn180Deg[sdir], node.param2)
|
local out_side = dir_to_side(tubelib2.Turn180Deg[sdir], node.param2)
|
||||||
return spos, out_side, Name2Name[node.name] or node.name
|
return spos, out_side, Name2Name[node.name] or node.name
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
See LICENSE.txt for more information
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
detector.lua:
|
detector.lua:
|
||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
|
|
||||||
@ -75,11 +75,11 @@ minetest.register_node("tubelib_addons1:detector", {
|
|||||||
"button_exit[2,2;3,1;exit;Save]")
|
"button_exit[2,2;3,1;exit;Save]")
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
tubelib.remove_node(pos)
|
tubelib.remove_node(pos)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_rotate = screwdriver.disallow,
|
on_rotate = screwdriver.disallow,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
@ -108,7 +108,7 @@ minetest.register_node("tubelib_addons1:detector_active", {
|
|||||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
tubelib.remove_node(pos)
|
tubelib.remove_node(pos)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
light_source = 2,
|
light_source = 2,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
@ -131,6 +131,7 @@ minetest.register_craft({
|
|||||||
|
|
||||||
tubelib.register_node("tubelib_addons1:detector", {"tubelib_addons1:detector_active"}, {
|
tubelib.register_node("tubelib_addons1:detector", {"tubelib_addons1:detector_active"}, {
|
||||||
on_push_item = function(pos, side, item)
|
on_push_item = function(pos, side, item)
|
||||||
|
if side ~= "L" then return false end
|
||||||
local player_name = minetest.get_meta(pos):get_string("player_name")
|
local player_name = minetest.get_meta(pos):get_string("player_name")
|
||||||
if tubelib.push_items(pos, "R", item, player_name) then
|
if tubelib.push_items(pos, "R", item, player_name) then
|
||||||
switch_on(pos)
|
switch_on(pos)
|
||||||
@ -139,5 +140,5 @@ tubelib.register_node("tubelib_addons1:detector", {"tubelib_addons1:detector_act
|
|||||||
return false
|
return false
|
||||||
end,
|
end,
|
||||||
is_pusher = true, -- is a pulling/pushing node
|
is_pusher = true, -- is a pulling/pushing node
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user