Even newer way of defining valid sides

This commit is contained in:
Cam B 2021-01-23 17:20:59 +00:00
parent 15557e6dc4
commit dab766b30d
2 changed files with 10 additions and 3 deletions

@ -340,9 +340,15 @@ function tubelib.register_node(name, add_names, node_definition)
end end
if node_definition.on_pull_item or node_definition.on_push_item or if node_definition.on_pull_item or node_definition.on_push_item or
node_definition.is_pusher then node_definition.is_pusher then
Tube:add_secondary_node_names({name}, node_definition.valid_sides) Tube:add_secondary_node_names({name})
Tube:add_secondary_node_names(add_names, node_definition.valid_sides) 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 tubelib.KnownNodes[name] = true
for _,n in ipairs(add_names) do for _,n in ipairs(add_names) do
tubelib.KnownNodes[n] = true tubelib.KnownNodes[n] = true

@ -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"})