From 9f493e8cb723137b7f42c501ba640d128d208fe4 Mon Sep 17 00:00:00 2001 From: Kotolegokot Date: Wed, 1 Aug 2012 23:28:02 +0600 Subject: [PATCH] Meselamp nodebox --- mesecons_lamp/init.lua | 48 +++++++++++------- mesecons_textures/textures/jeija_meselamp.png | Bin 0 -> 260 bytes .../textures/jeija_meselamp_off.png | Bin 209 -> 253 bytes .../textures/jeija_meselamp_on.png | Bin 200 -> 307 bytes .../jeija_meselamp_on_ceiling_off.png | Bin 196 -> 0 bytes .../textures/jeija_meselamp_on_ceiling_on.png | Bin 205 -> 0 bytes .../textures/jeija_meselamp_on_floor_off.png | Bin 194 -> 0 bytes .../textures/jeija_meselamp_on_floor_on.png | Bin 208 -> 0 bytes 8 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 mesecons_textures/textures/jeija_meselamp.png delete mode 100644 mesecons_textures/textures/jeija_meselamp_on_ceiling_off.png delete mode 100644 mesecons_textures/textures/jeija_meselamp_on_ceiling_on.png delete mode 100644 mesecons_textures/textures/jeija_meselamp_on_floor_off.png delete mode 100644 mesecons_textures/textures/jeija_meselamp_on_floor_on.png diff --git a/mesecons_lamp/init.lua b/mesecons_lamp/init.lua index fcceeed..1ece13a 100644 --- a/mesecons_lamp/init.lua +++ b/mesecons_lamp/init.lua @@ -1,35 +1,49 @@ -- MESELAMPS minetest.register_node("mesecons_lamp:lamp_on", { - drawtype = "torchlike", - tile_images = {"jeija_meselamp_on_ceiling_on.png", "jeija_meselamp_on_floor_on.png", "jeija_meselamp_on.png"}, - inventory_image = "jeija_meselamp_on_floor_on.png", + drawtype = "nodebox", + tile_images = {"jeija_meselamp_on.png"}, paramtype = "light", + paramtype2 = "wallmounted", + legacy_wallmounted = true, sunlight_propagates = true, walkable = false, - legacy_wallmounted = true, - paramtype2 = "wallmounted", light_source = LIGHT_MAX, + node_box = { + type = "wallmounted", + wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125}, + wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125}, + wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125}, + }, selection_box = { - --type = "wallmounted", - --type = "fixed", - fixed = {-0.38, -0.5, -0.1, 0.38, -0.2, 0.1}, + type = "wallmounted", + wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125}, + wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125}, + wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125}, }, groups = {dig_immediate=3,not_in_creative_inventory=1}, drop='"mesecons_lamp:lamp_off" 1', }) minetest.register_node("mesecons_lamp:lamp_off", { - drawtype = "torchlike", - tile_images = {"jeija_meselamp_on_ceiling_off.png", "jeija_meselamp_on_floor_off.png", "jeija_meselamp_off.png"}, - inventory_image = "jeija_meselamp_on_floor_off.png", - wield_image = "jeija_meselamp_on_ceiling_off.png", + drawtype = "nodebox", + tile_images = {"jeija_meselamp_off.png"}, + inventory_image = "jeija_meselamp.png", + wield_image = "jeija_meselamp.png", paramtype = "light", + paramtype2 = "wallmounted", sunlight_propagates = true, walkable = false, - wall_mounted = false, + node_box = { + type = "wallmounted", + wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125}, + wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125}, + wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125}, + }, selection_box = { - --type = "fixed", - fixed = {-0.38, -0.5, -0.1, 0.38, -0.2, 0.1}, + type = "wallmounted", + wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125}, + wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125}, + wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125}, }, groups = {dig_immediate=3}, description="Meselamp", @@ -46,14 +60,14 @@ minetest.register_craft({ mesecon:register_on_signal_on(function(pos, node) if node.name == "mesecons_lamp:lamp_off" then - minetest.env:add_node(pos, {name="mesecons_lamp:lamp_on"}) + minetest.env:add_node(pos, {name="mesecons_lamp:lamp_on", param2 = node.param2}) nodeupdate(pos) end end) mesecon:register_on_signal_off(function(pos, node) if node.name == "mesecons_lamp:lamp_on" then - minetest.env:add_node(pos, {name="mesecons_lamp:lamp_off"}) + minetest.env:add_node(pos, {name="mesecons_lamp:lamp_off", param2 = node.param2}) nodeupdate(pos) end end) \ No newline at end of file diff --git a/mesecons_textures/textures/jeija_meselamp.png b/mesecons_textures/textures/jeija_meselamp.png new file mode 100644 index 0000000000000000000000000000000000000000..5456ee98aea05dec000fdce822a9665ec1f658be GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPa2cw{f*EC9V-A&iT2ysd*&~&PAz-C8;S2 z<(VZJ3hti10pX2&;y^_?o-U3d7N_4%-pG5{fQQAuk&Ex^&6h2cL4F4((#GEjuGz$3Dlfq`2Xgc%uT&5-~K zvX^-Jy0YKlU=-xn{pWspEl^0Z#5JPCIX^cyHLrxhxhOTUBsE2$JhLQ2!QIn0AiR-J z9H=PO)5S5w;`H0e)?5byI9RSHJX~n=FIDc;xe$Jz6X#W2yL^^z=s2Mf04Eg8D0BX7`=i feg8(FBtzPS873;Mf;|pE8yP%Z{an^LB{Ts5!?NMQuIzVM_!-sB(+l_71BH@3T^vI+&i7v2$lGAR<8o2HV}g>DmDM--hDoUoCO!-r zoM}ymV_v66S~X8zz&5qD)91=;>Fr-lq=u)R>VpkhIl!hhyX r?d>;(Jk2v@9xkb|%|5=P;4@R}2k}(ahneL-`xrc3{an^LB{Ts5$16f0 diff --git a/mesecons_textures/textures/jeija_meselamp_on.png b/mesecons_textures/textures/jeija_meselamp_on.png index 45cb35c882559ac8e5bb20f617063433149302e3..2316e00e670c03d4e02025549f0a77798577a3f9 100644 GIT binary patch delta 280 zcmX@XxS45!N9s+Qe9ZYt%OiL$EM(=Mwj{y)vOXV@6w&zao{lT+$q}} zxjx@myej(B98*U=jXe*zZt%`!a0uQ0N@3WVoKb?ICeKVmaKYQa+3*blLH=V+Zz{@}Z7B!2;OQb$4nuFf3k00009a7bBm000XU000b50SdsWga7~l2XskI zMF-pj4*@4O5O$5J00015NklmmCfQBTkIb!>+BoHou3ndH}cwFFify-Ose@OO} a=jR3RoEvQM9G(>b0000k44ofy`glX(f`a29w(7Bet# z3o|hA_%U)FSlI#;WH0gbb!ET9!q2E7;}aUO0Vova>EaloasKV8y}V5U3~m=cGYWZg zal04%50p9BCLqi${E4e>-d3N4hdbZ$mY=uUvE+K@TC?t>5#iVGn9Mm7cjbN8c4H~I qWg_lJrzqqo6-ktduHAqCBO}{++1fj7dQX5hFnGH9xvXv!soVEiwu~U z7aU-nbAa*9ksV4#R}Zgi*}D1RV*A_6GVOLT<|it;C!Y{^23p17>FVdQ&MBb@0Haby A*8l(j diff --git a/mesecons_textures/textures/jeija_meselamp_on_floor_off.png b/mesecons_textures/textures/jeija_meselamp_on_floor_off.png deleted file mode 100644 index d6c79432d001aa262139d213faa336a49b3d8e42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf67>k44ofy`glX(f`a29w(7Bet# z3o|hA_%U)FSlI#;WH0gbb!ET9!q2E-Qu*M67f>j~)5S4F%hoE|v@{p}QR(lwTxB4H}E_05LgKW7E^cLglk oyEa<2DkW^L&n~w45jhr&VY7tyb-DeP1)9&`>FVdQ&MBb@05+CFPyhe` diff --git a/mesecons_textures/textures/jeija_meselamp_on_floor_on.png b/mesecons_textures/textures/jeija_meselamp_on_floor_on.png deleted file mode 100644 index deae3db2f04484b4835bd478baad9723928c8e13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg&7!l{1~|otZV@avX^-Jy0YJ4;b+ujTcIEak-aXL9cf^~6%NC2yWQgPh= zykGiCO2-czP&fbtXMy-A5OaloYi?|O$b5LV`EyAZ*Vhkz%}D4eef{j8`n9l>tvUv5 x?8ocb%*+DW+>Wuh)y%T5oAYmeGjpOiL)Af1q0EDMUO?LzJYD@<);T3K0RZn>MWO%z