From 281f4b539b5bdf86f6a4d04bc0bc3b949fe32807 Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Thu, 12 Sep 2019 22:53:29 +0000 Subject: [PATCH] undo preventing machines from pushing to themselves; make detector only accept items on the input side --- tubelib/command.lua | 1 - tubelib_addons1/detector.lua | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tubelib/command.lua b/tubelib/command.lua index 6e226bf..4380193 100644 --- a/tubelib/command.lua +++ b/tubelib/command.lua @@ -139,7 +139,6 @@ local function get_dest_node(pos, side) local dir = side_to_dir(side, node.param2) local spos, sdir = Tube:get_connected_node_pos(pos, dir) if not (spos and sdir) then return end - if vector.equals(pos, spos) then return end _,node = Tube:get_node(spos) local out_side = dir_to_side(tubelib2.Turn180Deg[sdir], node.param2) return spos, out_side, Name2Name[node.name] or node.name diff --git a/tubelib_addons1/detector.lua b/tubelib_addons1/detector.lua index f7c5ad9..e657344 100644 --- a/tubelib_addons1/detector.lua +++ b/tubelib_addons1/detector.lua @@ -9,7 +9,7 @@ See LICENSE.txt for more information detector.lua: - + ]]-- @@ -75,11 +75,11 @@ minetest.register_node("tubelib_addons1:detector", { "button_exit[2,2;3,1;exit;Save]") end end, - + after_dig_node = function(pos, oldnode, oldmetadata, digger) tubelib.remove_node(pos) end, - + on_rotate = screwdriver.disallow, paramtype = "light", sunlight_propagates = true, @@ -108,7 +108,7 @@ minetest.register_node("tubelib_addons1:detector_active", { after_dig_node = function(pos, oldnode, oldmetadata, digger) tubelib.remove_node(pos) end, - + paramtype = "light", light_source = 2, sunlight_propagates = true, @@ -131,6 +131,7 @@ minetest.register_craft({ tubelib.register_node("tubelib_addons1:detector", {"tubelib_addons1:detector_active"}, { 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") if tubelib.push_items(pos, "R", item, player_name) then switch_on(pos) @@ -139,5 +140,5 @@ tubelib.register_node("tubelib_addons1:detector", {"tubelib_addons1:detector_act return false end, is_pusher = true, -- is a pulling/pushing node -}) +})