From bdcb9172a612b3b521ac60f95de9341e06adebed Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Wed, 2 Jan 2019 12:51:57 +0100 Subject: [PATCH] industrial lamps added --- tubelib_addons2/industriallamp.lua | 188 ++++++++++++++++++ tubelib_addons2/init.lua | 1 + .../tubelib_addon2_access_control.png | Bin 648 -> 291 bytes .../tubelib_addon2_mesecons_converter.png | Bin 705 -> 301 bytes .../textures/tubelib_addon2_repeater.png | Bin 255 -> 252 bytes .../textures/tubelib_addon2_timer.png | Bin 275 -> 272 bytes .../tubelib_addons2_ceilinglamp_top.png | Bin 547 -> 158 bytes .../tubelib_addons2_industriallamp1.png | Bin 0 -> 268 bytes .../tubelib_addons2_industriallamp1_on.png | Bin 0 -> 605 bytes .../tubelib_addons2_industriallamp2.png | Bin 0 -> 229 bytes .../tubelib_addons2_industriallamp2_on.png | Bin 0 -> 244 bytes .../tubelib_addons2_industriallamp_inv1.png | Bin 0 -> 560 bytes .../tubelib_addons2_industriallamp_inv2.png | Bin 0 -> 620 bytes .../tubelib_addons2_invisiblelamp.png | Bin 150 -> 147 bytes ...ubelib_addons2_invisiblelamp_inventory.png | Bin 328 -> 325 bytes .../textures/tubelib_addons2_sequencer.png | Bin 444 -> 254 bytes .../tubelib_addons2_streetlamp_top.png | Bin 406 -> 216 bytes 17 files changed, 189 insertions(+) create mode 100644 tubelib_addons2/industriallamp.lua create mode 100644 tubelib_addons2/textures/tubelib_addons2_industriallamp1.png create mode 100644 tubelib_addons2/textures/tubelib_addons2_industriallamp1_on.png create mode 100644 tubelib_addons2/textures/tubelib_addons2_industriallamp2.png create mode 100644 tubelib_addons2/textures/tubelib_addons2_industriallamp2_on.png create mode 100644 tubelib_addons2/textures/tubelib_addons2_industriallamp_inv1.png create mode 100644 tubelib_addons2/textures/tubelib_addons2_industriallamp_inv2.png diff --git a/tubelib_addons2/industriallamp.lua b/tubelib_addons2/industriallamp.lua new file mode 100644 index 0000000..a3a5aab --- /dev/null +++ b/tubelib_addons2/industriallamp.lua @@ -0,0 +1,188 @@ +--[[ + + Tubelib Addons 2 + ================ + + Copyright (C) 2017-2018 Joachim Stolberg + + LGPLv2.1+ + See LICENSE.txt for more information + + industriallamp.lua: + +]]-- + +local function register_lamp(tbl) + local num, tiles, tiles_on, node_box, size = tbl.num, tbl.tiles, tbl.tiles_on, tbl.node_box, tbl.size + minetest.register_node("tubelib_addons2:industriallamp"..num, { + description = "Tubelib Industrial Lamp "..num, + tiles = tiles, + drawtype = "nodebox", + node_box = node_box, + inventory_image = 'tubelib_addons2_industriallamp_inv'..num..'.png', + + selection_box = { + type = "wallmounted", + wall_top = {-size.x, 0.5 - size.y, -size.z, size.x, 0.5, size.z}, + wall_bottom = {-size.x, -0.5, -size.z, size.x, -0.5 + size.y, size.z}, + wall_side = {-0.5, -size.z, size.x, -0.5 + size.y, size.z, -size.x}, + }, + + after_place_node = function(pos, placer) + local number = tubelib.add_node(pos, "tubelib_addons2:industriallamp"..num) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Tubelib Industrial Lamp "..num..": "..number) + end, + + on_rightclick = function(pos, node, clicker) + if not minetest.is_protected(pos, clicker:get_player_name()) then + node.name = "tubelib_addons2:industriallamp"..num.."_on" + minetest.swap_node(pos, node) + end + end, + + after_dig_node = function(pos) + tubelib.remove_node(pos) + end, + + paramtype = "light", + light_source = 0, + sunlight_propagates = true, + paramtype2 = "wallmounted", + groups = {choppy=2, cracky=2, crumbly=2}, + is_ground_content = false, + sounds = default.node_sound_glass_defaults(), + }) + + minetest.register_node("tubelib_addons2:industriallamp"..num.."_on", { + description = "Tubelib Industrial Lamp "..num, + tiles = tiles_on, + drawtype = "nodebox", + node_box = node_box, + + selection_box = { + type = "wallmounted", + wall_top = {-size.x, 0.5 - size.y, -size.z, size.x, 0.5, size.z}, + wall_bottom = {-size.x, -0.5, -size.z, size.x, -0.5 + size.y, size.z}, + wall_side = {-0.5, -size.z, size.x, -0.5 + size.y, size.z, -size.x}, + }, + + after_place_node = function(pos, placer) + local number = tubelib.add_node(pos, "tubelib_addons2:industriallamp"..num) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Tubelib Industrial Lamp "..num..": "..number) + end, + + on_rightclick = function(pos, node, clicker) + if not minetest.is_protected(pos, clicker:get_player_name()) then + node.name = "tubelib_addons2:industriallamp"..num + minetest.swap_node(pos, node) + local pos1 = {x=pos.x-5, y=pos.y-5, z=pos.z-5} + local pos2 = {x=pos.x+5, y=pos.y+5, z=pos.z+5} + minetest.fix_light(pos1, pos2) + end + end, + + paramtype = "light", + light_source = minetest.LIGHT_MAX, + sunlight_propagates = true, + paramtype2 = "wallmounted", + groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, + drop = "tubelib_addons2:industriallamp"..num, + is_ground_content = false, + sounds = default.node_sound_glass_defaults(), + }) + + tubelib.register_node("tubelib_addons2:industriallamp"..num, {"tubelib_addons2:industriallamp"..num.."_on"}, { + on_recv_message = function(pos, topic, payload) + local node = minetest.get_node(pos) + if topic == "on" then + switch_on(pos, node) + elseif topic == "off" then + switch_off(pos, node) + end + end, + }) +end + +minetest.register_craft({ + output = "tubelib_addons2:industriallamp1 2", + recipe = { + {"", "", ""}, + {"default:glass", "tubelib:wlanchip", "dye:grey"}, + {"basic_materials:plastic_strip", "default:copper_ingot", "basic_materials:plastic_strip"}, + }, +}) + +minetest.register_craft({ + output = "tubelib_addons2:industriallamp2 2", + recipe = { + {"default:glass", "default:glass", ""}, + {"tubelib:wlanchip", "dye:black", ""}, + {"basic_materials:steel_bar", "basic_materials:steel_bar", ""}, + }, +}) + + +register_lamp({ + num = 1, + tiles = { + -- up, down, right, left, back, front + 'tubelib_addons2_industriallamp1.png', + 'tubelib_addons2_industriallamp1.png', + 'tubelib_addons2_industriallamp1.png^[transformR180', + 'tubelib_addons2_industriallamp1.png^[transformR180', + 'tubelib_addons2_industriallamp1.png', + 'tubelib_addons2_industriallamp1.png', + }, + tiles_on = { + -- up, down, right, left, back, front + 'tubelib_addons2_industriallamp1_on.png', + 'tubelib_addons2_industriallamp1_on.png', + 'tubelib_addons2_industriallamp1_on.png^[transformR180', + 'tubelib_addons2_industriallamp1_on.png^[transformR180', + 'tubelib_addons2_industriallamp1_on.png', + 'tubelib_addons2_industriallamp1_on.png', + }, + node_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -3/32, -6/16, -9/32, 3/32}, + { 6/16, -8/16, -3/32, 8/16, -9/32, 3/32}, + {-6/16, -7/16, -1/16, 6/16, -5/16, 1/16}, + }, + }, + size = {x = 8/16, y = 7/32, z = 3/32} +}) + +register_lamp({ + num = 2, + tiles = { + -- up, down, right, left, back, front + 'tubelib_addons2_industriallamp2.png', + 'tubelib_addons2_industriallamp2.png', + 'tubelib_addons2_industriallamp2.png^[transformR180', + 'tubelib_addons2_industriallamp2.png^[transformR180', + 'tubelib_addons2_industriallamp2.png', + 'tubelib_addons2_industriallamp2.png', + }, + tiles_on = { + -- up, down, right, left, back, front + 'tubelib_addons2_industriallamp2_on.png', + 'tubelib_addons2_industriallamp2_on.png', + 'tubelib_addons2_industriallamp2_on.png^[transformR180', + 'tubelib_addons2_industriallamp2_on.png^[transformR180', + 'tubelib_addons2_industriallamp2_on.png', + 'tubelib_addons2_industriallamp2_on.png', + }, + node_box = { + type = "fixed", + fixed = { + {-8/32, -16/32, -4/32, 8/32, -9/32, 4/32}, + {-7/32, -16/32, -5/32, 7/32, -9/32, 5/32}, + {-7/32, -9/32, -4/32, 7/32, -8/32, 4/32}, + }, + }, + size = {x = 8/32, y = 8/32, z = 5/32} +}) + \ No newline at end of file diff --git a/tubelib_addons2/init.lua b/tubelib_addons2/init.lua index 190a99a..21e980c 100644 --- a/tubelib_addons2/init.lua +++ b/tubelib_addons2/init.lua @@ -20,6 +20,7 @@ dofile(minetest.get_modpath("tubelib_addons2") .. "/accesscontrol.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/streetlamp.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/ceilinglamp.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/invisiblelamp.lua") +dofile(minetest.get_modpath("tubelib_addons2") .. "/industriallamp.lua") if minetest.get_modpath("mesecons") and mesecon then dofile(minetest.get_modpath("tubelib_addons2") .. "/mesecons_converter.lua") diff --git a/tubelib_addons2/textures/tubelib_addon2_access_control.png b/tubelib_addons2/textures/tubelib_addon2_access_control.png index df7a6b07d6db98af357f081434689742595fcf90..b03bb7370e8e2b084bf3af048c8b7d631e5666cd 100644 GIT binary patch delta 240 zcmeBRUCcB=LXCx)fq|hhB>gy$Vo7)Ob!1@J*w6hZkrl{iEDmyaVpw-h=H>8k@44$rjF6*2UngF;eNnii~ delta 600 zcmV-e0;m0>0*D2W7()mK0001UdV2H#000JJOGiWi{{a60|De66lK=n!32;bRa{vGf z6951U69E94oEQKA00(qQO+^Rc3LO?V7KL{|!;wBGe*y4GL_t(o!|hi+Z^AGTeXcr0 zfjL_N$w&~fRO6uAabc9%#3^TF`p4s*Kl80012Bqr*+irhB{@4;l^tV(xtz zU&dITe}spMF3!yLX2mLTz;gv_#1jU99bRUhE12gB=5RlQJKSga__WvU06Wr&O89!S zV(nHpDcu1g5Ir64!*c~1@uU#d=U*1D0D#$aui>GLFdSLuodZ-E zZ9w*T{{#SPgWjO2DyK0iqP7gv_GUal%mEl5f8*UY)?}zUVgP|0Baol*wL1{X2zeDa z+-ISTkXM1{3N{>B8N7@FezpocSK#sfNqze??r{I|Dj>3@&;H#uR`Y3`6mk{^sIu8~ zk5EQxQBp@JBjo@x6%R+2O1QQPI^0AcKU9!rHEkHkaVEYuXd;lhIx2U-w)?8`qBFn4 ze@#sthcSxog5RM6@-*IvCr9syMm(vng1o&fUeV#E#_Zw9LMWp`vh@bd(j+{YfNl5D z8#FPS?zII&85Jf*&U>cv7h@-A}f&3SRCZ;#IWw1%*%<<>h%nq z1s;*b3=G`DAk4@xYmNj^4Nrhih^tR#p{Ki>w}-o~mWJw<-m5@y=8_=4U4$0 wpJ0i(VzDH9+1x<>%lG0W{ZeZGKiVvJd6xm#-Vje0pc5E8UHx3vIVCg!0JmvYHUIzs delta 657 zcmV;C0&e}S0>K547()mK0001UdV2H#000JJOGiWi{{a60|De66lK=n!32;bRa{vGf z6951U69E94oEQKA00(qQO+^Rc3J4DqB*=KMw~;<4e*!5zTbtD~HFb3TcTBw^|C3Fd-^whWLd-N^(06hpT?X85AQre5bsE2}9g@8k3FgQMh z*xQR&tk;ruxR04zUN{P66SkuX-2lz^m|MvC8lM+&>^uw;O(1>HOa{5FCSNj004*wHKfmws^Pn7*WZ(iMgb{=N=_AMo|gVvd^6JU(xwbz?fJ~I+Q zNIvCYJOY3@Z`(Sm98{eJ0B{HZ^OEMH4W3H?5sQWlKXm^3)c{(pmi%xt5uJVyP0K#w zf67%NFdmPU?R%2mE+^@2Sqw{PjK1euK}aZfPN!3K75w=5tFBSc0KgI*msj8P`T!rP z+fG5@EqoOlQKf09>R`eJI9ag-aX5(0r%1ajB{d_r7(G7ELJG(Lz6 a)PST*g8YIR9G=}sn^>wbF+g(0r%1ajB{d_r7(G7ELJG(Lz6 a)PST*g8YIR9G=}sn^>wbF+g_!xhs2 delta 94 zcmbQhG?{6FN+4T+Plzi61B0%X#(5o%bwCzlNswPKgTu2MX&_FLx4R2N2dk_Hki%Kv q5n0T@z%2~Ij105pNB{-dOFVsD*&lMT2}+u-b7*Xv7^^XHRv7^1trh?P diff --git a/tubelib_addons2/textures/tubelib_addons2_ceilinglamp_top.png b/tubelib_addons2/textures/tubelib_addons2_ceilinglamp_top.png index 3dcc333a7e13ee3100529034105360aa69ef9434..835c1c371635f7212631ed0e7d1bf7715b7f0365 100644 GIT binary patch delta 142 zcmZ3?GLLbBL_H%j0|SHSmKWQB6id3JuOkD)#(wTUiL5|AV{wqX6T`Z5GB1G~wg8_H zSD(znpTB>kq_36&NtXoq1v5B2yO9Rua29w(7Bet#3xhBt!>l&XcR ln11~K|KC7>MT~*L`9D>003Z6OjJd%cRsd(IJkpBx{5!)jWooKM8S_e z%#KIP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/tubelib_addons2_industriallamp2_on.png b/tubelib_addons2/textures/tubelib_addons2_industriallamp2_on.png new file mode 100644 index 0000000000000000000000000000000000000000..33e5b300fdd6d5dc14f684dd7a9148616855d136 GIT binary patch literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv{s5m4*VGbSYb&cCzrO$Z|NH;{ z|DP;k;($_&B|(0{3=Yq3q=7g|-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLNg-FY)ws zWq-`b#LZ&T^x)5PpirEri(`n!`Q!u!MmI+VfdmHz9!4>DadAQRDDDYtEU^s-1YJ5B zI2?7DG8lG?iMl5%2m~pqDCD>_E!1F2VG?(r@KZ_8gGs>oA(L7HqoV4L2Cj)rhuk_6 eT7ELmW?<;JYoJ=Ak&^qW_opWl9Z98rlY>Uy!H3=-Q16k00001VoOIv0Eh)0NB{r;32;bRa{vGf6951U z69E94oEQKA00(qQO+^Re0Rjs!GpDYavj6}Ao=HSOR7l6=)J<}NFcbjbc!MU=0|c;p z(YmjKu50sP-wGa}ExCRJ0eSg@12n^enSAqp2zex4Smb|!YyqTV0TklM=D;3Av7G@4 zDDW`@3V^&2SrDY4fOD8qxtYw*c7a z8lVgSz65lakT0icT@-6RO)9cWzu zMg%7bNhWabfPAyS`T@#*U$!g|q0|AS{9?WzX4+DSw~R7l6=)Jt>PFc1LXwVdQEDYUsN z2IDK^hH~{Vnei1!8($$w$LIK={rg?XghaMX&TTXdqhUYRtCcK>J{j;|0`UnDAo)4K zfrcCh6c6Y#3MkGB)k_L){ww^0O8NoCCx%?7 ze`CNcc!1yqg*FyUK9>0gelE%r`1TqMLCN32qy-NUCX^-SdxjYs0L@HjVZjvZpbw^P zXu(YfK6LX4X3d3t1UrH~>w&nwG@%;u4!oCnoXjf=G*CC%Ym-a%fZYWGIcjdosR9=y zds`$bDuq27%3ZK(VP!xCdCNK~U4WaU`<-$4ZYFmw$T71S^a8@)ftk(M?lLhmjd{hk9_Tf7m|L zp`a8i515u)W)2PQgGsS#1}{#G%60&^l;TbdL6kROtI#}Yf@M1d^pI{x4h&QDfGE~# z-Zea8`0TqM^2RJxuLYF2_JL`+xzIa){iu@Ge+9*w-%2_URhW)kVyUF;`d2!B4HnzW zm-O5{89&P}aNGZTK#EZyP6N(|eL%Rw1+pJL0pa;?H~s>*u43{~V=;FC0000(0r%1ag=Id_r7(G7Ei=->?G7 il?3?(GdMiEkp|>&7I;J!Gca%qgD@k*tT_@Bi&OyeofdHb delta 88 zcmbQtIE`_FiXU@;Plzi61H?NMQuI!IE1OyEPG*lihpO~)#0GYoOPXGV_ diff --git a/tubelib_addons2/textures/tubelib_addons2_invisiblelamp_inventory.png b/tubelib_addons2/textures/tubelib_addons2_invisiblelamp_inventory.png index 9638bc15c78ae32e0da14a376a7d14de0ec13e91..1767749c682612ec1a67d9d96efe32fbf06e3e7f 100644 GIT binary patch delta 70 zcmX@Xbd+g=iX}_Bqpu?a!^VE@KZ&di3=E9LLGDfr>(0r%1ajB{d_r7(G7C948C-k4 X-+-h`g8YIR9G=}so9HVsvEl*%#S0Zo delta 71 zcmX@gbb@JuiY8ltPl)TOlMEc340;EixG^v=FqQ=Q1v5B2yO9RsBze2LFm$lWdQ6O! Z5MVFy^mS!_#33NeY{q-+I?KeO%K+eZ6q*14 diff --git a/tubelib_addons2/textures/tubelib_addons2_sequencer.png b/tubelib_addons2/textures/tubelib_addons2_sequencer.png index 49217be124fb60934fb138618ebceed12c13cc54..6d028a8ea5a07c1d34356fe3575eeb9bd8c951c6 100644 GIT binary patch delta 203 zcmdnP{Eu;hgc>6=0|SHSmKWQB6id3JuOkD)#(wTUiL5|AV{wqX6T`Z5GA}1atJgDd z7I;J!Gca%qgD@k*tT_@uHEaPsA+A1|g}PcAAH)S}K)OnT{DK)Ap4~_Ta{N7A978y+ zCnp@>zaej7U~uBU#eo9>|HVE2Y-AUb|G{ryV3)uy#NMFujQNwpqJwfS45kW#4oe+W x9n1m>nLVVLPcSG1{_kf@(U7`P!Ss!pVdVqKe|J%0cI delta 394 zcmV;50d@ZV0lWi{7()mK0001UdV2H#000JJOGiWi{{a60|De66lK=n!32;bRa{vGf z6951U69E94oEQKA00(qQO+^Rc3J((^I()(C%aJ}Oe*q*(L_t(o!|hf}3WP8WO+*Co zA|klz{g059AYMcSHd=d#MQt?cB^Wr5sOJmObSR1D9$jowS6t>O@Shrb!KqZ zAd=!!a*sLWRo$SbM3EY3?#oR@_>Qq&z=!Q;0^nB#fPpsTj2!Qu4-*(eeQQ<6;LGF)5S4_<9ch~M!^FLJj_P}1B{p! z8%Rm&E;e9NWj%iU8&l!OsXBYvWJ+&jZ3szpTyka^*$BW+ZKY^YSYYuHaYz_Y>&{86nOF4^c z!=nNj>m_!p;^UgnF-F z-HGWoMb}KX3Cs**j9P$84$hWDZeJ48@`~Ylje`}Jp RUzY#?002ovPDHLkV1hs0po#zh