From ba57e8679fe71661a9565d2329c5c818afb3b16c Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 16 Jun 2019 23:21:41 +0200 Subject: [PATCH] v1.4 optional param tubetype added --- README.md | 1 + internal2.lua | 11 ----------- tube_api.lua | 3 ++- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index eeb7018..e1548bf 100644 --- a/README.md +++ b/README.md @@ -75,3 +75,4 @@ Textures: CC0 - 2019-03-02 v1.1 * API function 'switch_tube_line' added, secondary node placement bugfix - 2019-04-18 v1.2 * 'force_to_use_tubes' added - 2019-05-01 v1.3 * API function 'compatible_node' added +- 2019-05-09 v1.4 * Attribute 'tube_type' added diff --git a/internal2.lua b/internal2.lua index eed8432..538d475 100644 --- a/internal2.lua +++ b/internal2.lua @@ -63,22 +63,11 @@ local Dir6dToVector = {[0] = {x=0, y=1, z=0}, } -local VectorToDir6d = { - [{x=0, y=0, z=1}] = 1, - [{x=1, y=0, z=0}] = 2, - [{x=0, y=0, z=-1}] = 3, - [{x=-1, y=0, z=0}] = 4, - [{x=0, y=-1, z=0}] = 5, - [{x=0, y=1, z=0}] = 6, -} - - tubelib2.Tube = Tube tubelib2.Turn180Deg = Turn180Deg tubelib2.DirToParam2 = DirToParam2 tubelib2.Param2ToDir = Param2ToDir tubelib2.Dir6dToVector = Dir6dToVector -tubelib2.VectorToDir6d = VectorToDir6d -- diff --git a/tube_api.lua b/tube_api.lua index d94d4d1..e4c3411 100644 --- a/tube_api.lua +++ b/tube_api.lua @@ -13,7 +13,7 @@ ]]-- -- Version for compatibility checks, see readme.md/history -tubelib2.version = 1.3 +tubelib2.version = 1.4 -- for lazy programmers local S = function(pos) if pos then return minetest.pos_to_string(pos) end end @@ -148,6 +148,7 @@ function Tube:new(attr) show_infotext = attr.show_infotext or false, force_to_use_tubes = attr.force_to_use_tubes or false, clbk_after_place_tube = attr.after_place_tube, + tube_type = attr.tube_type or "unknown", pairingList = {}, -- teleporting nodes connCache = {}, -- connection cache {pos1 = {dir1 = {pos2 = pos2, dir2 = dir2},...} }