Nathan Salapat 01010dfc0e working vents! | 2 éve | |
---|---|---|
.. | ||
locale | 2 éve | |
textures | 2 éve | |
COPYING.txt | 2 éve | |
LICENSE.txt | 2 éve | |
README.md | 2 éve | |
description.txt | 2 éve | |
design.txt | 2 éve | |
i18n.py | 2 éve | |
init.lua | 2 éve | |
internal1.lua | 2 éve | |
internal2.lua | 2 éve | |
intllib.sh | 2 éve | |
mod.conf | 2 éve | |
settingtypes.txt | 2 éve | |
storage.lua | 2 éve | |
tube_api.lua | 2 éve | |
tube_test.lua | 2 éve |
A library for mods which need connecting tubes / pipes / cables or similar.
This mod is not useful for its own. It does not even have any nodes. It only comes with a few test nodes to play around with the tubing algorithm.
Browse on: GitHub
Download: GitHub
Tubelib2 distinguished two kinds of nodes:
Tubelib2 specific 6D directions (1 = North, 2 = East, 3 = South, 4 = West, 5 = Down, 6 = Up)
All 6D dirs are the view from the node to the outer side Tubes are based on two node types, "angled" and "straight" tubes.
+-------+
/ /| +-------+
/ / | / /|
/ / + / / |
/ / / +-------+ |
+-------+ / | | |
| | / | |/ |
| |/ +-------+| +
+-------+ | |/
+------+
All other nodes are build by means of axis/rotation variants based on param2 (paramtype2 == "facedir").
The 3 free MSB bits of param2 of tube nodes are used to store the number of connections (0..2).
The data of the peer head tube are stored in memory 'self.connCache'
Tubelib2 provides an update mechanism for connected "secondary" nodes. A callback function func(node, pos, out_dir, peer_pos, peer_in_dir) will be called for every change on the connected tubes.
optional: default
Copyright (C) 2017-2022 Joachim Stolberg Code: Licensed under the GNU LGPL version 2.1 or later.
See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt
Textures: CC0