From 35d86e1b16a82cd32b5161b8f402e5a04d6373a9 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 9 Dec 2016 16:34:10 +0100 Subject: [PATCH] Initial commit --- depends.txt | 1 + init.lua | 196 ++++++++++++++++++++ mod.conf | 1 + textures/mesecons_filter2_closed.png | Bin 0 -> 500 bytes textures/mesecons_filter2_closed_detail.png | Bin 0 -> 341 bytes textures/mesecons_filter2_open.png | Bin 0 -> 352 bytes textures/mesecons_filter2_open_detail.png | Bin 0 -> 145 bytes textures/mesecons_filter_closed.png | Bin 0 -> 569 bytes textures/mesecons_filter_open.png | Bin 0 -> 341 bytes textures/mesecons_filter_open_detail.png | Bin 0 -> 266 bytes textures/mesecons_window_closed.png | Bin 0 -> 423 bytes textures/mesecons_window_open.png | Bin 0 -> 328 bytes textures/mesecons_window_open_detail.png | Bin 0 -> 254 bytes 13 files changed, 198 insertions(+) create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 mod.conf create mode 100644 textures/mesecons_filter2_closed.png create mode 100644 textures/mesecons_filter2_closed_detail.png create mode 100644 textures/mesecons_filter2_open.png create mode 100644 textures/mesecons_filter2_open_detail.png create mode 100644 textures/mesecons_filter_closed.png create mode 100644 textures/mesecons_filter_open.png create mode 100644 textures/mesecons_filter_open_detail.png create mode 100644 textures/mesecons_window_closed.png create mode 100644 textures/mesecons_window_open.png create mode 100644 textures/mesecons_window_open_detail.png diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..acaa924 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +mesecons diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..22c53e5 --- /dev/null +++ b/init.lua @@ -0,0 +1,196 @@ +-- Window Block + +minetest.register_node("mesecons_window:window_closed", { + description="Mesecon Window", + _doc_items_longdesc = "A Mesecon receptor which is opaque when it isn't powered and is fully transparent to light and sunlight when powered.", + tiles = {"mesecons_window_closed.png"}, + is_ground_content = false, + groups = {cracky=3, oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults(), + mesecons = {conductor = { + state = mesecon.state.off, + rules = { --axes + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = -1, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, + }, + onstate = "mesecons_window:window_open" + }} +}) + +minetest.register_node("mesecons_window:window_open", { + description="Mesecon Window", + _doc_items_create_entry = false, + drawtype = "glasslike_framed", + sunlight_propagates = true, + tiles = {"mesecons_window_open.png", "mesecons_window_open_detail.png"}, + is_ground_content = false, + paramtype = "light", + groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1}, + drop = "mesecons_window:window_closed", + sounds = default.node_sound_glass_defaults(), + mesecons = {conductor = { + state = mesecon.state.on, + rules = { + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = -1, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, + }, + offstate = "mesecons_window:window_closed" + }}, + on_construct = function(pos) + -- remove shadow + shadowpos = vector.add(pos, vector.new(0, 1, 0)) + if (minetest.get_node(shadowpos).name == "air") then + minetest.dig_node(shadowpos) + end + end +}) + +minetest.register_node("mesecons_window:filter_closed", { + description="Mesecon Filter Window", + tiles = {"mesecons_filter_closed.png"}, + _doc_items_longdesc = "A Mesecon receptor which is opaque when it isn't powered and is semi-transparent to light when powered.", + is_ground_content = false, + groups = {cracky=3, oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults(), + mesecons = {conductor = { + state = mesecon.state.off, + rules = { --axes + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = -1, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, + }, + onstate = "mesecons_window:filter_open" + }} +}) + +minetest.register_node("mesecons_window:filter_open", { + description="Mesecon Filter Window", + drawtype = "glasslike_framed", + _doc_items_create_entry = false, + sunlight_propagates = false, + tiles = {"mesecons_filter_open.png", "mesecons_filter_open_detail.png"}, + is_ground_content = false, + paramtype = "light", + groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1}, + drop = "mesecons_window:filter_closed", + sounds = default.node_sound_glass_defaults(), + mesecons = {conductor = { + state = mesecon.state.on, + rules = { + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = -1, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, + }, + offstate = "mesecons_window:filter_closed" + }}, + on_construct = function(pos) + -- remove shadow + shadowpos = vector.add(pos, vector.new(0, 1, 0)) + if (minetest.get_node(shadowpos).name == "air") then + minetest.dig_node(shadowpos) + end + end +}) + +minetest.register_node("mesecons_window:filter2_closed", { + description="Mesecon Filter Glass", + _doc_items_longdesc = "A Mesecon receptor which lets light through. When not powered, it is semi-transparent, i.e. it is transparent to light, but filters out sunlight. When powered, it is fully transparent to light and sunlight.", + drawtype="glasslike_framed", + tiles = {"mesecons_filter2_closed.png", "mesecons_filter2_closed_detail.png"}, + is_ground_content = false, + groups = {cracky=3, oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults(), + paramtype = "light", + sunlight_propagates = false, + mesecons = {conductor = { + state = mesecon.state.off, + rules = { --axes + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = -1, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, + }, + onstate = "mesecons_window:filter2_open" + }}, + on_construct = function(pos) + -- remove shadow + shadowpos = vector.add(pos, vector.new(0, 1, 0)) + if (minetest.get_node(shadowpos).name == "air") then + minetest.dig_node(shadowpos) + end + end +}) + +minetest.register_node("mesecons_window:filter2_open", { + description="Mesecon Filter Glass", + _doc_items_create_entry = false, + drawtype = "glasslike_framed", + sunlight_propagates = false, + tiles = {"mesecons_filter2_open.png", "mesecons_filter2_open_detail.png"}, + is_ground_content = false, + paramtype = "light", + sunlight_propagates = true, + groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory=1}, + drop = "mesecons_window:filter2_closed", + sounds = default.node_sound_glass_defaults(), + mesecons = {conductor = { + state = mesecon.state.on, + rules = { + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = -1, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, + }, + offstate = "mesecons_window:filter2_closed" + }}, + on_construct = function(pos) + -- remove shadow + shadowpos = vector.add(pos, vector.new(0, 1, 0)) + if (minetest.get_node(shadowpos).name == "air") then + minetest.dig_node(shadowpos) + end + end +}) + + +minetest.register_craft({ + output = 'mesecons_window:window_closed', + recipe = { + {"", "default:glass", ""}, + {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"}, + } +}) + +minetest.register_craft({ + output = 'mesecons_window:filter_closed', + recipe = { + {"", "default:pine_needles", ""}, + {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"}, + } +}) + +minetest.register_craft({ + output = 'mesecons_window:filter2_closed', + recipe = { + {"", "default:glass", ""}, + {"default:pine_needles", "group:mesecon_conductor_craftable", "default:pine_needles"}, + } +}) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..345dcd8 --- /dev/null +++ b/mod.conf @@ -0,0 +1 @@ +name = mesecons_window diff --git a/textures/mesecons_filter2_closed.png b/textures/mesecons_filter2_closed.png new file mode 100644 index 0000000000000000000000000000000000000000..38196e8d7e400916e78adba8399a9f8cf0af52e2 GIT binary patch literal 500 zcmVPx#32;bRa{vGf6951U69E94oEQKA00(qQO+^Rb3 zlTC8dKoEt$o*BuGD`!c?Tf|wi^_Jj*$dSF0ik}27!CiC(E)rYd%uln3CE{Qe6tkJ> zc{Q(JzwVK{FEdRMtg{3k0U@6#VDXOt5$hlZVKP-x5<-A1Q&IvG1C%$N{QPl22y
7KlgIrfZ{KvX-3lf|pRV?sh@+F%0A!E)P#`!`!8q$X+F%`sf10D`WUgb0Q1&;uQo_o4DhFF|FI@vL=*@4G(z9w_ymhgp% zXBVzAdCM18ur-qZZL9=`OObfWk~hnP_H5LR{B_^|*Cl@5_D9oG*NIH{^x{MC+6IZo z6`qMRvl(>z7yo$4vcUD_lh>Cgm#j^lsr@!eJ2v}cu6 zy{LlXrb~4hFQT;nUeHj8&90o&oK#SFf2+n^7t0-Yzs+MgdO*Q~X^Z@l&W0A1}T6c+OMh%vleXXZ^R9 lPL2L`sf10D`WVaBun^8W*cK6$!0hFF|lIyunqumg|F{j%+z@2>Ot9+9cu-`!dCmSR;YIQnZ%*Q5@KggtO? zjI0rf$h#CJVII-Mez(B(?~ZR4)sYnf>5aB>GgfV7k6vH+Uf||MIU|Q}Q8QlMwS3X8 zaqrfGpCRXYcK!95mlj`sf10D`WVUY#O-6B9CWltB!5R22v2@>-jy#N2`|B((u10XQ$ kVQRZrVlazOLPCOJRX6Y6hX1!d0+lm(y85}Sb4q9e0Q;OK(*OVf literal 0 HcmV?d00001 diff --git a/textures/mesecons_filter_closed.png b/textures/mesecons_filter_closed.png new file mode 100644 index 0000000000000000000000000000000000000000..a9343168e2417f3f73aeaa65eae7d419ede471a0 GIT binary patch literal 569 zcmV-90>=G`P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^Rb3e)kQbJW}t+3lgh=JV&YOSqk481NxdYvpVW5#cxzA?)N_x!o4VIU%J$j1iV{ zo+pb*N`Vj}trlvnhzPgaK?t7fsHsuF@{bDo?FtyVyY;lR6{S_`FQ#BMkruoetJE|uQ(zvf&E z`|gM_V#S~eW(;MaPnq5Bh%q1{lv?N=HeDbmNnY@2=BoJ*l!C$}RKLL%S6jIo|JYri;d z2e+4mYDYvKA3STm9S1Qc&ekclvOB}J@A9-c#z^lMZ|@mZMO86l%%{!Q=;TsRRgRQc z6Sm$Ludm+_V}Qy1E`;z%)j3Po$-Nl*FJ(;-Bd~;A7Cyjlgj`;zti@I<00000NkvXX Hu0mjf3H<(^ literal 0 HcmV?d00001 diff --git a/textures/mesecons_filter_open.png b/textures/mesecons_filter_open.png new file mode 100644 index 0000000000000000000000000000000000000000..3d655fabfc026d54295ebc303384d8c38f5e6777 GIT binary patch literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sf10D_rb^ZzKZd(9_o_o4DhFF|lI{9GGVFMnQ`N`%l?Y~a8 zDAbtp@WwyG)*}D;LzyP8&UIdwEBv)*BK@Cx8M!jUFgYWu)0 z>AOP@)8)Jr=I5s$ev51N?Wl8zKJxsu1S`$5!|RNIpb9&+jqamw-h&R_T-tcS8!R{XSpxVBKf%&L@s>PQ@_r4 z@s{7`Kw0sl>#j?lJ6F>)dGhm6zkOnzXC?QfA90`mZzH?Lj7baboD*5_I$=Nm6s4e9 lE=zmV=N0>2{xXGW{_{(JJoYehG6TKL;OXk;vd$@?2>@Loh`sf10D_rb;waA_w}>C zK+F{jM9+VCaLdU;K348ndPPC5;+(s8lK#$T9Ci;ZKwzNHo4rNw9e(#_1 z$pA=-EPuBD|LRWe=KcRqcb0K7?_~7Yy61q0&$Oe**%@L^K3HnAWqT^noeZ9?elF{r G5}E*thiU-; literal 0 HcmV?d00001 diff --git a/textures/mesecons_window_closed.png b/textures/mesecons_window_closed.png new file mode 100644 index 0000000000000000000000000000000000000000..e57e6bb4aef55166a04b524992c795fb04da75e0 GIT binary patch literal 423 zcmV;Y0a*TtP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^Rb3ltX~47R0)`Tzg{IY~r8R5;6> z)5}T&F%*E||D0qxRa(4Y)i+W5jN(&y!}rjIm8$5XOpcCkXoZ{}JYyjU~ zoco7cG-m-oMQ}hBVgz@=+%flGeLi=z@9Sy+F$gg#A=Ei{htCCm^7(9umSTV+3aW~G zZFHa%M?~rmKlt;@HL>r**A@ZH>|3)LU(KzD0J^_-M)CULU(KzT0{XbRBt}Lxw>}It zYjkt#lZggt)hR3eKqJ*5BT4 z(U;eo(ao)!K^z9>adlnK6JxUxwzle1olF8L8ApdpR!>)$fvVsxbe%Ju!UrbT3$uY& R&inuX002ovPDHLkV1lI8vbX>M literal 0 HcmV?d00001 diff --git a/textures/mesecons_window_open.png b/textures/mesecons_window_open.png new file mode 100644 index 0000000000000000000000000000000000000000..d5690dd5643eaf60aa8374575078de113a30a7a4 GIT binary patch literal 328 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sf18xy(`OLo7}&oqRLsuz`s4`LC0vH^8fYr$oYE|}YtIhX_ zhq!JO3_aml`nqqi~d6%4+>#n@?I}2x}@ttFTAMP@*wC+y+ zy!*=!D14vZ{9oyL)9ht$`I2M`&-Kn`JtL*Jw8(J5-$&&^JAWUYdg)=n<9>t{an^LB{Ts5gam=f literal 0 HcmV?d00001 diff --git a/textures/mesecons_window_open_detail.png b/textures/mesecons_window_open_detail.png new file mode 100644 index 0000000000000000000000000000000000000000..433d0312ee1c0e74b1eb97ea7340f7d301f7ac28 GIT binary patch literal 254 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sf18xyWHwu{K=gcrHy^9O zQjY#OH8wBCP2B(ft^d>SeRsWm>i^D9hwlGBYQg*SxBYK>M|}h1Z$|(A#&=v5NISN& zr~ZHVpY#P{6(DnjRW}|uaKNEbC*XR+{{P;EY!~|DfBxr`I&kL3*^bi!eA_xf%Kxit sY5xBk->0q{!n-LWMdcVnO{6qKpP=ui>5tfYfo@~)boFyt=akR{0AL?oZvX%Q literal 0 HcmV?d00001