From 270990cdee65298c1822b533f2e9a1d8c6ac4d05 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sat, 31 Aug 2019 21:19:09 +0200 Subject: [PATCH] wind turbine finished and recipes added --- basic_machines/funnel.lua | 1 + basic_machines/gravelrinser.lua | 1 + basic_machines/gravelsieve.lua | 1 + basic_machines/grinder.lua | 1 + doc/ta4_doc.lua | 56 +++++++++++++++ init.lua | 2 + nodes/pillar.lua | 10 ++- textures/techage_carbon_fiber.png | Bin 0 -> 858 bytes textures/techage_epoxy.png | Bin 0 -> 300 bytes textures/techage_pillar_inv.png | Bin 0 -> 616 bytes textures/techage_rotor.png | Bin 468 -> 219 bytes textures/techage_rotor_blade.png | Bin 0 -> 1054 bytes textures/techage_rotor_blades.png | Bin 3085 -> 737 bytes textures/techage_rotor_lamp_off.png | Bin 0 -> 347 bytes textures/techage_rotor_lamp_on.png | Bin 0 -> 286 bytes textures/techage_rotor_top.png | Bin 428 -> 251 bytes wind_turbine/rotor.lua | 103 +++++++++++++++++++++----- wind_turbine/signallamp.lua | 108 ++++++++++++++++++++++++++++ 18 files changed, 264 insertions(+), 19 deletions(-) create mode 100644 doc/ta4_doc.lua create mode 100644 textures/techage_carbon_fiber.png create mode 100644 textures/techage_epoxy.png create mode 100644 textures/techage_pillar_inv.png create mode 100644 textures/techage_rotor_blade.png create mode 100644 textures/techage_rotor_lamp_off.png create mode 100644 textures/techage_rotor_lamp_on.png create mode 100644 wind_turbine/signallamp.lua diff --git a/basic_machines/funnel.lua b/basic_machines/funnel.lua index 2663d2b..c31b16d 100644 --- a/basic_machines/funnel.lua +++ b/basic_machines/funnel.lua @@ -101,6 +101,7 @@ minetest.register_node("techage:ta3_funnel", { }, drawtype = "nodebox", + paramtype = "light", node_box = { type = "fixed", fixed = { diff --git a/basic_machines/gravelrinser.lua b/basic_machines/gravelrinser.lua index 05720e5..12ee439 100644 --- a/basic_machines/gravelrinser.lua +++ b/basic_machines/gravelrinser.lua @@ -250,6 +250,7 @@ local tubing = { local node_name_ta2, node_name_ta3, node_name_ta4 = techage.register_consumer("rinser", S("Gravel Rinser"), tiles, { drawtype = "nodebox", + paramtype = "light", node_box = { type = "fixed", fixed = { diff --git a/basic_machines/gravelsieve.lua b/basic_machines/gravelsieve.lua index 4e52816..61fa1e6 100644 --- a/basic_machines/gravelsieve.lua +++ b/basic_machines/gravelsieve.lua @@ -187,6 +187,7 @@ local tubing = { local node_name_ta2, node_name_ta3, node_name_ta4 = techage.register_consumer("gravelsieve", S("Gravel Sieve"), tiles, { drawtype = "nodebox", + paramtype = "light", node_box = { type = "fixed", fixed = { diff --git a/basic_machines/grinder.lua b/basic_machines/grinder.lua index 09e8d2a..285e94d 100644 --- a/basic_machines/grinder.lua +++ b/basic_machines/grinder.lua @@ -193,6 +193,7 @@ local tubing = { local node_name_ta2, node_name_ta3, node_name_ta4 = techage.register_consumer("grinder", S("Grinder"), tiles, { drawtype = "nodebox", + paramtype = "light", node_box = { type = "fixed", fixed = { diff --git a/doc/ta4_doc.lua b/doc/ta4_doc.lua new file mode 100644 index 0000000..b2c5c43 --- /dev/null +++ b/doc/ta4_doc.lua @@ -0,0 +1,56 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2019 Joachim Stolberg + + GPL v3 + See LICENSE.txt for more information + + Main module for the in-game TA4documentation + +]]-- + +local S = techage.S + +techage.register_category_page("ta4", + S("Future Age (TA4)"), + S("The Future Age is the forth level of the available technic stages.@n".. + "The goal of TA4 is to operate your machines only with renewable energy.@n".. + "Build wind turbines, solar panel plants and biogas plants and use@n".. + "future technologies."), + "techage:ta4_wlanchip", + {} +) + + +local ROTOR = "techage_wind_turbine_inv.png" +local CANELLE = "techage_rotor.png" +local PILLAR = "techage_pillar_inv.png" + +local Images = { + {false, false, false, ROTOR, CANELLE, false, false}, + {false, false, false, PILLAR, false, false, false}, + {false, false, false, PILLAR, false, false, false}, + {false, false, false, PILLAR, false, false, false}, + {false, false, false, PILLAR, false, false, false}, + {false, false, false, PILLAR, false, false, false}, + {false, false, false, PILLAR, false, false, false}, + {false, false, false, PILLAR, false, false, false}, +} + +--techage.register_entry_page("ta3", "power_station", +techage.register_category_page("ta4wt", + S("TA4: Wind Turbine"), + S("Build a Wind Turbine according to the plan with TA4 Wind Turbine, TA4 Wind Turbine Nacelle and@n".. + "a pillar by means of TA4 Pillar nodes (power cables have to be inside).@n".. + "Please note the following limitations:@n".. + "- pillar height between 10 and 19 m@n".. + "- can only be built offshore (the info tool indicates where a wind turbine can be built)@n".. + "- 14 m free space in all 4 directions (e.g. to the next wind turbine)@n".. + "- the wind blows only between 5 and 9 o'clock and between 17 and 21 o'clock"), + nil, + {}, + Images) + diff --git a/init.lua b/init.lua index 463a99b..44feb52 100644 --- a/init.lua +++ b/init.lua @@ -47,6 +47,7 @@ else dofile(MP.."/doc/ta1_doc.lua") dofile(MP.."/doc/ta2_doc.lua") dofile(MP.."/doc/ta3_doc.lua") + dofile(MP.."/doc/ta4_doc.lua") -- Nodes1 dofile(MP.."/nodes/baborium.lua") @@ -181,4 +182,5 @@ else -- Wind dofile(MP.."/wind_turbine/rotor.lua") dofile(MP.."/nodes/pillar.lua") + dofile(MP.."/wind_turbine/signallamp.lua") end \ No newline at end of file diff --git a/nodes/pillar.lua b/nodes/pillar.lua index 08e5644..45c48c8 100644 --- a/nodes/pillar.lua +++ b/nodes/pillar.lua @@ -23,9 +23,17 @@ minetest.register_node("techage:pillar", { type = "fixed", fixed = {-8/32, -16/32, -8/32, 8/32, 16/32, 8/32}, }, - + backface_culling = true, groups = {cracky=1}, on_rotate = screwdriver.disallow, is_ground_content = false, sounds = default.node_sound_stone_defaults(), }) + + + +minetest.register_craft({ + type = "shapeless", + output = "techage:pillar", + recipe = {"basic_materials:concrete_block"}, +}) diff --git a/textures/techage_carbon_fiber.png b/textures/techage_carbon_fiber.png new file mode 100644 index 0000000000000000000000000000000000000000..93e8e225b69c5e17a6a4d6af1cc0e509cb450fdb GIT binary patch literal 858 zcmV-g1Eu_lP)Px%$9hy)bW&k=AaHVTW@&6?Aar?fWgumEX=VTbc-oy+ zTb3&)4E$#mSps?>&~kX`oa`XWPtk7Q@l5VGlfY?^g-{iez-j;WXQV$)^QuWpZRTbf zOZUuXrOoWL6!r%7cq4*8Wc;=X^v>I3l~S~o7AK4 zi%oiWJ8P!K1#%lvqylFx)CXP-U?eiEyACnMr3mOp={jq<7^ELk;9h!cL3ElMWR9h4xwo^fuJnPW{I@eor^O<@+D#rnh{5PFE6M z7*Br#H%!xCO)rLR00009P)t-sCM7CTQdx+W-In07*qoM6N<$g815c^8f$< literal 0 HcmV?d00001 diff --git a/textures/techage_epoxy.png b/textures/techage_epoxy.png new file mode 100644 index 0000000000000000000000000000000000000000..d4db6e8e17cfbcb5c033d5a1992e7908b3635167 GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvi2$Dv*Tez_1||=4Gqa$;zy%BE zA31jT+RZCBZ{M)7wln~$VJr#q3ubV5b|VeQ;VkfoEM{Qf76xHPhFNnYfP(BLp1!W^ zk2&PItxZZ}tzQ6zWHUn|N}Tg^b5rw5fLsO!=c3falGGH1^30M91$R&1fE2w{cA$8n zr;B5V#`)v~1)-KEhB?QVENRhX2x1jaFf(%#O$g%Ub-j34%FCnSC@WV%Hm3*+a}Cqe zR)r3g0F4L^mJ?bmrvq6Vv{(W|MZ~xk&2YRCwLw*b>FEomM-GZ6qD`$CX$v?P+-#DQ j%gGFIs8LAfSiry#`qlo-^>y)&L9X(2^>bP0l+XkK`5#ws literal 0 HcmV?d00001 diff --git a/textures/techage_pillar_inv.png b/textures/techage_pillar_inv.png new file mode 100644 index 0000000000000000000000000000000000000000..bb2ea6281262c0df273ddd3e9d9b972ad251c19a GIT binary patch literal 616 zcmV-u0+;=XP)Px#9#BkFMNDaNfrEgYo|}7pdTVWJbar#1q@iePXNHJ{ zU}9gE{vFx?0004WQchCFc5`9hSF6P1&y&xL{?)A-K*fWPz%$ob*aeMf{W=^Ck^;#_nqW)@j3kg5rG)) zd@px~%pD$l&?dd$v)eTj(Z}g0a)&@l!)36##0!#qB;edu5=%AHw#>r`Aq^7olV(_u3p?*>x-+MV=R~+E!)9DI@@7o;&BNwq$``0YJT| zTWdMspn9|@oU75nayck?a5({`WyVa!fEGpm=xTW205u2^Tg(8%AV;9dgNiu z*0$_*DLd5H|mdznWOj(@5c5@3u3N(d1 z1CT;H1E_xh6%~pA@V6=Mq5`(sp7nq+@29|Z1`qNCyfd#s+*MpTMBRNaIElX&&U>cv7h@-A}f&3SRCZ;#IWw1%*% sjL9n+6nAksKRSCrb3qH6gqs-y!((0E)Qp$G=|D{kp00i_>zopr0G2ZO}0002|8116~000SaNLh0L01FcU01FcV0GgZ_00007bV*G` z2jd7H6E+xFqP**oJ}Z9#N=ZaPR7l6wR?CuvAPh_(SRVNQ-`J1y0xltYh|4I>FqY`n zPM;Ktbm+W55rI2FjXh>odSeVC>Y|A37aPF!4VW1KthGHZr< zdPQT5{+jh(;pjo--$o)4>G54L&+{-0&k6dGb1vd61lJ~|_g;Thnx<(X`11bNIxuiE z%()0Kz_&;Sczc{Oz=^uD0QOkE8NRs}nE~;`gAAXJ-c}(Z%p5}SFA5g_Vxm7-vxtw!KiHL}3-|bOEQc7h~;uU3~+%d*+98uMHjL-uF%#4WD zT~*liI9n{2jrL+(E02k_6Z)|?y)pGPi{pB`!Wg55>%SD*nO?M(yIsBKZy>+W z+$||DB9(fLs?<|2CF*%2ZQidU5<+m!?bAjJP#?Lc$!-tw54i0FoTg)i-T(jq07*qo IM6N<$f`Zt&;s5{u diff --git a/textures/techage_rotor_blade.png b/textures/techage_rotor_blade.png new file mode 100644 index 0000000000000000000000000000000000000000..aba770d684feb5f41531c02f800b629eb397a58c GIT binary patch literal 1054 zcmV+(1mXLMP)Px#32;bRa{vGf6951U69E94oEQKA076hqR7Ff_ammQZ z%xh}QNl4Gm(9X=x#K*|ZLqo@wmBqTh*Vot3&d$op%G1-+&M+|6+}zGrSJbVo%fG+X zkB`oOf6i%XDTMp&0000AbW%=J0I7P;(RNY({vxJPBz^z@15ZgrK~z}7rI!hEgD?z5 z6Ov%CEbzwtuUaj}IL!)CJJad3ethXm7CBw}aXkGJ;LbmtKRE}k{|!KhYyTU-0bIx9 zH4p;g?H~g6IOlOY1h9aXLQ8Q(gp>1DGr{wC6o91^usaV20?-^FMz_~e=M+GNM6{7( z*p-Kiq#wiy3MYW28~3E3={tHpT2Kj->Ats7(`NvOD)45yjJp6)0Tu%vo{XpXGLO~5 z2$n05Ck_EDaQ+gYIbca&f&o6yc>4|j($3<5o2rByi2AuJYz=Y1EvjIM^NiBppSpVk zXbxdA^!TivXn(&)SgZujfn1P)4d4*^4=$_{^0Hd!V*_}9=WQ7Pnrb0C&=Lso8h~m9 zMcOR9%R$1vxbv*$Ab?;t3-Ld|+2>t>ipB&ILL@WOL~r0P+vp z7}gxL!1SdOA}Lsm$^P!Hpo^HVQU`hSFwJXk6oAfaT*M{Lq_K3o%HODsR|zRVJzgcm z5QZe@r-cBaz5e?vUngY_eU$vS(*m%NQbYq+b?>=AZ)Q|DFu^?Wz*E$HkJEnV_RikFV-p0mxKXLmW^E zR0Ol6Xq!Fo60oWu9Ri>h$k}WDbF&BD08V4CwNL;r+)2}K6mXLE&4n-JLW+V6)vf#kK)3Qw074Az Y53{#l&5$61;Q#;t07*qoM6N<$f|A(a4FCWD literal 0 HcmV?d00001 diff --git a/textures/techage_rotor_blades.png b/textures/techage_rotor_blades.png index d2895f8937870e53696ab4f0950ebad691987ef7..eaffea3908824829d5c652a786d3258aa91af688 100644 GIT binary patch delta 725 zcmV;`0xJED7~utw7=Hu<00013M{Ml?000DMK}|sb0I`n?{9y$E0004VQb$4nuFf3k z00009a7bBm000XU000XU0RWnu7ytkO7*I@9Md|73-rnBy^z_-;+0e|);F+1>Ha6m6 zVJ6LABLDybQb|NXR7l5tmBDV?FbqIR%R{b|ln-#^?QU7Y&VNZ;^xPh@o`)d&f;Ij9 zk+NeaHZ>(s0_fq1qzDOuGLGKn!9P!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xQjf@`af`KayT|Q77YLZ N002ovPDHLkV1llCr(^&C diff --git a/textures/techage_rotor_lamp_off.png b/textures/techage_rotor_lamp_off.png new file mode 100644 index 0000000000000000000000000000000000000000..a689f0bff1ad4950d8e9a9e2f98348cb9398fc50 GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfV-9&iO~ag`nL*@w^k$J3gFs_sZ7mI5BUdkBjB>_gX%E20I!xe@cg#q&G`F%~mM7!;{i6-Ld^a z!UgU5<^kEudA=NyWZrNpqhZ<&p0;o651v1m(0!`9;Zb|kmnV;6op|rLoM1M|*eJk% zcY%MPO$c-J_WNS%G}U;vjb? zhIQv;UIIC?nIRD+&iT2ysd*(pE(3#eQEFmIYKlU6W=V#EyQgnJie4%^P@J>CBeIx* zfm;}a85w5HkpKw>_=LE=V`1@Ea6_Bs&>^I z82dvSw|hw5@t7)Px7zZowB1dX=Q=S;i&pXXF`7SW=&C)?79mq)d{EIeneQ5p%!6ee z&+?iwULA8;E8USaW72ZYOsVz14*u_${6=0|SHSmKWQB6id3JuOkD)#(wTUiL5|AV{wqX6T`Z5GA}23YEM)a zt6>Z9332`Z|Noyqf1b*D`T&)Ldb&7O}0002|8116~000SaNLh0L01FcU01FcV0GgZ_00007bV*G` z2jd7H6E_t<2=Nz@J}Z9#B1uF+R7l6|R?CiqFbu>_g82V$<&Z>v?7?hELmMGdR$2+4 zXiPo!crq=h>U3xLPL7!k9uWb+4psGd*a@g7VCHF>oO2^B6OnVSVDA7TvK;}OY3)bH%L1w@BD<J4v|OQOH(a=+>(?BQ7YrPSLcGqW`~ z&X{iiQ%bh3Z|Mr|Haq-u*ZU%2<{0Dk3G_EiyG8P<+OTJ@na3PcJ&HzbqqcPHc-F~U zM6|AJ^IgQPIQ%-rFIwYJ9a=BS^f9}~>>jiG?`8+88e 20 then if player_name then - minetest.chat_send_player(player_name, "[TA4 Wind Turbine] No wind at this altitude!") + minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]").. + " "..S("No wind at this altitude!")) end + M(pos):set_string("infotext", S("TA4 Wind Turbine").." "..S("Error")) + mem.error = true return end @@ -85,6 +95,14 @@ local function add_rotor(pos, player_name) end local function start_rotor(pos, mem) + local npos = techage.get_pos(pos, "F") + local node = minetest.get_node(npos) + if node.name ~= "techage:ta4_wind_turbine_nacelle" then + M(pos):set_string("infotext", S("TA4 Wind Turbine").." "..S("Error")) + mem.error = true + return + end + mem.providing = true power.generator_start(pos, mem, PWR_PERF) local hash = minetest.hash_node_position(pos) @@ -105,7 +123,6 @@ end local function node_timer(pos, elapsed) local mem = tubelib2.get_mem(pos) - print("node_timer", mem.running, mem.providing) if not mem.running then return false end @@ -148,7 +165,7 @@ minetest.register_node("techage:ta4_wind_turbine", { meta:set_string("infotext", S("TA4 Wind Turbine").." "..own_num) mem.providing = false mem.running = true - add_rotor(pos, placer:get_player_name()) + add_rotor(pos, mem, placer:get_player_name()) minetest.get_node_timer(pos):start(CYCLE_TIME) end, @@ -206,7 +223,9 @@ techage.register_node({"techage:ta4_wind_turbine"}, { local mem = tubelib2.get_mem(pos) print("on_recv_message", topic) if topic == "state" then - if mem.running and mem.providing then + if mem.error then + return "error" + elseif mem.running and mem.providing then return "running" else return "stopped" @@ -220,19 +239,67 @@ techage.register_node({"techage:ta4_wind_turbine"}, { end end, on_node_load = function(pos) - add_rotor(pos) local mem = tubelib2.get_mem(pos) + add_rotor(pos, mem) mem.providing = false -- to force the rotor start minetest.get_node_timer(pos):start(CYCLE_TIME) end, }) +minetest.register_craftitem("techage:ta4_epoxy", { + description = S("TA4 Epoxide Resin"), + inventory_image = "techage_epoxy.png", +}) ---minetest.register_craft({ --- output = "techage:ta4_wind_turbine", --- recipe = { --- {"", "techage:ta4_wlanchip", ""}, --- {"techage:ta4_silicon_wafer", "techage:ta4_silicon_wafer", "techage:ta4_silicon_wafer"}, --- {"default:tin_ingot", "techage:iron_ingot", "default:copper_ingot"}, --- }, ---}) +minetest.register_craftitem("techage:ta4_carbon_fiber", { + description = S("TA4 Carbon Fiber"), + inventory_image = "techage_carbon_fiber.png", +}) + +minetest.register_craftitem("techage:ta4_rotor_blade", { + description = S("TA4 Rotor Blade"), + inventory_image = "techage_rotor_blade.png", +}) + + +minetest.register_craft({ + output = "techage:ta4_wind_turbine", + recipe = { + {"dye:white", "techage:ta4_rotor_blade", "dye:red"}, + {"basic_materials:gear_steel", "techage:generator", "basic_materials:gear_steel"}, + {"techage:ta4_rotor_blade", "techage:electric_cableS", "techage:ta4_rotor_blade"}, + }, +}) + +minetest.register_craft({ + output = "techage:ta4_wind_turbine_nacelle", + recipe = { + {"default:steel_ingot", "", "default:steel_ingot"}, + {"dye:white", "techage:ta4_wlanchip", "dye:red"}, + {"", "default:copper_ingot", ""}, + }, +}) + +minetest.register_craft({ + output = "techage:ta4_rotor_blade", + recipe = { + {"techage:ta4_carbon_fiber", "dye:white", "techage:ta4_carbon_fiber"}, + {"techage:ta4_epoxy", "techage:ta4_carbon_fiber", "techage:ta4_epoxy"}, + {"techage:ta4_carbon_fiber", "dye:red", "techage:ta4_carbon_fiber"}, + }, +}) + +techage.furnace.register_recipe({ + output = "techage:ta4_carbon_fiber", + recipe = {"default:papyrus", "default:stick", "default:papyrus", "default:stick"}, + heat = 4, + time = 3, +}) + +techage.furnace.register_recipe({ + output = "techage:ta4_epoxy", + recipe = {"basic_materials:oil_extract", "techage:oil_source", + "basic_materials:oil_extract", "techage:oil_source"}, + heat = 4, + time = 3, +}) diff --git a/wind_turbine/signallamp.lua b/wind_turbine/signallamp.lua new file mode 100644 index 0000000..ef5aeec --- /dev/null +++ b/wind_turbine/signallamp.lua @@ -0,0 +1,108 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2019 Joachim Stolberg + + GPL v3 + See LICENSE.txt for more information + + Colored Signal Lamp (requires unifieddyes) + +]]-- + +-- for lazy programmers +local M = minetest.get_meta +local S = techage.S + +local logic = techage.logic + +local COLORED = minetest.get_modpath("unifieddyes") and minetest.global_exists("unifieddyes") + + +local function switch_on(pos, node) + node.name = "techage:signal_lamp_on" + minetest.swap_node(pos, node) +end + +local function switch_off(pos, node) + node.name = "techage:signal_lamp_off" + minetest.swap_node(pos, node) +end + +minetest.register_node("techage:rotor_signal_lamp_off", { + description = S("TA4 Wind Turbine Signal Lamp"), + tiles = {"techage_rotor_lamp_off.png"}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-2/16, -8/16, -2/16, 2/16, -3/16, 2/16}, + }, + }, + + after_place_node = function(pos, placer, itemstack, pointed_thing) + minetest.get_node_timer(pos):start(2) + end, + + on_timer = function(pos, elapsed) + minetest.swap_node(pos, {name = "techage:rotor_signal_lamp_on"}) + return true + end, + + paramtype = "light", + paramtype2 = "glasslikeliquidlevel", + sunlight_propagates = true, + sounds = default.node_sound_glass_defaults(), + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + is_ground_content = false, + drop = "techage:rotor_signal_lamp_off" +}) + +minetest.register_node("techage:rotor_signal_lamp_on", { + description = S("TA4 Wind Turbine Signal Lamp"), + tiles = {"techage_rotor_lamp_on.png"}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-2/16, -8/16, -2/16, 2/16, -3/16, 2/16}, + }, + }, + + on_timer = function(pos, elapsed) + minetest.swap_node(pos, {name = "techage:rotor_signal_lamp_off"}) + return true + end, + + paramtype = "light", + light_source = 8, + paramtype2 = "glasslikeliquidlevel", + sunlight_propagates = true, + sounds = default.node_sound_glass_defaults(), + groups = {cracky = 3, oddly_breakable_by_hand = 3, not_in_creative_inventory=1}, + is_ground_content = false, + drop = "techage:rotor_signal_lamp_off" +}) + +minetest.register_lbm({ + label = "Restart Lamp", + name = "techage:rotor_signal_lamp", + nodenames = {"techage:rotor_signal_lamp_on", "techage:rotor_signal_lamp_off"}, + run_at_every_load = true, + action = function(pos, node) + minetest.get_node_timer(pos):start(2) + end, +}) + + +minetest.register_craft({ + output = "techage:rotor_signal_lamp_off", + recipe = { + {"", "dye:red", ""}, + {"", "default:torch", ""}, + {"", "default:glass", ""}, + }, +}) +