From dab766b30d9d4503343b33af987c22d7a47bc48f Mon Sep 17 00:00:00 2001 From: Cam B Date: Sat, 23 Jan 2021 17:20:59 +0000 Subject: [PATCH] Even newer way of defining valid sides --- tubelib/command.lua | 10 ++++++++-- tubelib_addons3/teleporter.lua | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tubelib/command.lua b/tubelib/command.lua index bfadf1d..eb72ab4 100644 --- a/tubelib/command.lua +++ b/tubelib/command.lua @@ -340,9 +340,15 @@ function tubelib.register_node(name, add_names, node_definition) end if node_definition.on_pull_item or node_definition.on_push_item or node_definition.is_pusher then - Tube:add_secondary_node_names({name}, node_definition.valid_sides) - Tube:add_secondary_node_names(add_names, node_definition.valid_sides) + Tube:add_secondary_node_names({name}) + Tube:add_secondary_node_names(add_names) + if node_definition.valid_sides then + Tube:set_valid_sides(name, node_definition.valid_sides) + for _,n in ipairs(add_names) do + Tube:set_valid_sides(n, node_definition.valid_sides) + end + end tubelib.KnownNodes[name] = true for _,n in ipairs(add_names) do tubelib.KnownNodes[n] = true diff --git a/tubelib_addons3/teleporter.lua b/tubelib_addons3/teleporter.lua index ccaa661..8d5220a 100644 --- a/tubelib_addons3/teleporter.lua +++ b/tubelib_addons3/teleporter.lua @@ -75,4 +75,5 @@ minetest.register_craft({ }, }) -Tube:add_secondary_node_names({"tubelib_addons3:teleporter"}, {B=false, R=true, F=false, L=false, D=false, U=false}) +Tube:add_secondary_node_names({"tubelib_addons3:teleporter"}) +Tube:set_valid_sides("tubelib_addons3:teleporter", {"R"})