From 79e501394a155e99880d25ac4ae457e28ffa21a1 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 29 Jan 2017 03:31:02 -0500 Subject: [PATCH] fix missing 6dfacedir -> wallmounted in LBM code for glowlights --- homedecor/lighting.lua | 70 ++++++++++++++---- .../textures/homedecor_glowlight_bottom.png | Bin 119 -> 95 bytes .../homedecor_glowlight_cube_sides.png | Bin 135 -> 137 bytes ...homedecor_glowlight_cube_sides_ceiling.png | Bin 138 -> 139 bytes .../textures/homedecor_glowlight_cube_tb.png | Bin 140 -> 142 bytes .../homedecor_glowlight_thick_sides.png | Bin 178 -> 173 bytes .../homedecor_glowlight_thin_sides.png | Bin 134 -> 137 bytes .../textures/homedecor_glowlight_top.png | Bin 172 -> 162 bytes 8 files changed, 54 insertions(+), 16 deletions(-) diff --git a/homedecor/lighting.lua b/homedecor/lighting.lua index 1b97cddc..f9f5d21d 100644 --- a/homedecor/lighting.lua +++ b/homedecor/lighting.lua @@ -17,7 +17,7 @@ local glowlight_nodebox = { }, } -homedecor.register("glowlight_half", { +minetest.register_node("homedecor:glowlight_half", { description = S("Thick Glowlight"), tiles = { "homedecor_glowlight_top.png", @@ -27,14 +27,20 @@ homedecor.register("glowlight_half", { "homedecor_glowlight_thick_sides.png", "homedecor_glowlight_thick_sides.png" }, + drawtype = "nodebox", + paramtype = "light", paramtype2 = "colorwallmounted", palette = "unifieddyes_palette_colorwallmounted.png", - selection_box = glowlight_nodebox.half, + selection_box = { + type = "wallmounted", + wall_top = { -0.5, 0, -0.5, 0.5, 0.5, 0.5 }, + wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, + wall_side = { -0.5, -0.5, -0.5, 0, 0.5, 0.5 } + }, node_box = glowlight_nodebox.half, groups = { snappy = 3 }, light_source = default.LIGHT_MAX, sounds = default.node_sound_glass_defaults(), - on_place = minetest.rotate_node, after_dig_node = unifieddyes.after_dig_node, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) unifieddyes.on_rightclick(pos, node, clicker, @@ -42,7 +48,7 @@ homedecor.register("glowlight_half", { end, }) -homedecor.register("glowlight_quarter", { +minetest.register_node("homedecor:glowlight_quarter", { description = S("Thin Glowlight"), tiles = { "homedecor_glowlight_top.png", @@ -52,14 +58,20 @@ homedecor.register("glowlight_quarter", { "homedecor_glowlight_thin_sides.png", "homedecor_glowlight_thin_sides.png" }, + drawtype = "nodebox", + paramtype = "light", paramtype2 = "colorwallmounted", palette = "unifieddyes_palette_colorwallmounted.png", - selection_box = glowlight_nodebox.quarter, + selection_box = { + type = "wallmounted", + wall_top = { -0.5, 0.25, -0.5, 0.5, 0.5, 0.5 }, + wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }, + wall_side = { -0.5, -0.5, -0.5, -0.25, 0.5, 0.5 } + }, node_box = glowlight_nodebox.quarter, groups = { snappy = 3 }, light_source = default.LIGHT_MAX-1, sounds = default.node_sound_glass_defaults(), - on_place = minetest.rotate_node, after_dig_node = unifieddyes.after_dig_node, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) unifieddyes.on_rightclick(pos, node, clicker, @@ -67,7 +79,7 @@ homedecor.register("glowlight_quarter", { end, }) -homedecor.register("glowlight_small_cube", { +minetest.register_node("homedecor:glowlight_small_cube", { description = S("Small Glowlight Cube"), tiles = { "homedecor_glowlight_cube_tb.png", @@ -77,14 +89,20 @@ homedecor.register("glowlight_small_cube", { "homedecor_glowlight_cube_sides.png", "homedecor_glowlight_cube_sides.png" }, + paramtype = "light", paramtype2 = "colorwallmounted", + drawtype = "nodebox", palette = "unifieddyes_palette_colorwallmounted.png", - selection_box = glowlight_nodebox.small_cube, + selection_box = { + type = "wallmounted", + wall_top = { -0.25, 0, -0.25, 0.25, 0.5, 0.25 }, + wall_bottom = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }, + wall_side = { -0.5, -0.25, -0.25, 0, 0.25, 0.25 } + }, node_box = glowlight_nodebox.small_cube, groups = { snappy = 3 }, light_source = default.LIGHT_MAX-1, sounds = default.node_sound_glass_defaults(), - on_place = minetest.rotate_node, after_dig_node = unifieddyes.after_dig_node, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) unifieddyes.on_rightclick(pos, node, clicker, @@ -92,7 +110,6 @@ homedecor.register("glowlight_small_cube", { end, }) - homedecor.register("plasma_lamp", { description = S("Plasma Lamp"), drawtype = "glasslike_framed", @@ -563,7 +580,7 @@ minetest.register_lbm({ nodenames = homedecor.old_static_nodes, action = function(pos, node) local name = node.name - local newnode + local newname local color if string.find(name, "small_cube") then @@ -611,19 +628,40 @@ minetest.register_lbm({ color = "white" end - local paletteidx - local fdir + local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, false) + + local old_node = node.name + local old_fdir + local new_node = newname + local new_fdir + if string.find(name, "glowlight") then paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted") - param2 = paletteidx + (node.param2 % 8 ) + + old_fdir = math.floor(node.param2 / 4) + + if old_fdir == 5 then + new_fdir = 0 + elseif old_fdir == 1 then + new_fdir = 5 + elseif old_fdir == 2 then + new_fdir = 4 + elseif old_fdir == 3 then + new_fdir = 3 + elseif old_fdir == 4 then + new_fdir = 2 + elseif old_fdir == 0 then + new_fdir = 1 + end + param2 = paletteidx + new_fdir else - paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, false) param2 = paletteidx end print(node.name.." --> "..newname..", "..color.." ("..paletteidx.."), fdir = "..node.param2.." --> "..param2) + print("fdir "..dump(old_fdir).." --> "..dump(new_fdir)) - minetest.set_node(pos, { name = newname, param2 = param2 }) + minetest.set_node(pos, { name = new_node, param2 = param2 }) local meta = minetest.get_meta(pos) meta:set_string("dye", "unifieddyes:"..color) end diff --git a/homedecor/textures/homedecor_glowlight_bottom.png b/homedecor/textures/homedecor_glowlight_bottom.png index 47681a9db68ac8de18fd61252450fda7c02e0747..37a6b4d2cafc70e6f3ba2ff385e9e22c51a8523e 100644 GIT binary patch delta 64 zcmXSqpP*u`=IP=XB5^tS&)G948d&}r|NGr|CjCK*)5P?IgoGpsJEorh7i!oUG}>9E TKTK}_$p8eNu6{1-oD!MA*l6%K$${;SPLD`&J-F}Y+Wrnmf(fAjl4!%b#k>pJ&?UJO9s>FVdQ&MBb@02pB*`Tzg` diff --git a/homedecor/textures/homedecor_glowlight_cube_sides.png b/homedecor/textures/homedecor_glowlight_cube_sides.png index 79dbc83938f12ab04606e5fe05d9b24450c8186f..06182d059c4270d5f5fcc15e93ccc9195aad801c 100644 GIT binary patch delta 108 zcmV-y0F(cR0f_;SBxO)ZL_t&-)5Xle4S+xhM9~jHY{C9}vx!|;Jc-c;oa4*nOYxra z3mCxZW~>~?4eoBN`8;gf6{NbMrhw@uD$-C{K(20NjE$VpFj+yx0Js4Cs~IK$N7^U= O0000LOZfymiCTd8OZ)Q!v8^fr~ z2bcg6(@BF3BVx$Z2i!-f-2fawLV~+=tyb1u(&SXufkhit3&8ffbAEvjtQH~|IeWV( P00000NkvXXu0mjfi(4z+ diff --git a/homedecor/textures/homedecor_glowlight_cube_tb.png b/homedecor/textures/homedecor_glowlight_cube_tb.png index 3aa2387d8f072ea31b28398f53b6a7ba2aa224f4..d5f0615d51eb2141b5c5a15493a8edee4c06f2fa 100644 GIT binary patch delta 113 zcmV-%0FM8R0geHXBx+SjL_t&-)1{BW4Zt7_0}m2lh3-FFrw9${3sC#3>gUNi%PDv! z^BE|>*;Mgi#{{ibA^L7eDGDi;LsS9HFKOB<;Q@FoM;DXqc5RS{GTdOQ|9!au`;r(n T@&8;;00000NkvXXu0mjfW2i4c delta 111 zcmV-#0FeKV0gM5VBxqAfL_t&-m8H+i5r9Al15m=pMzsHeY=zz6$wjZq@lBE$yySf@ z-{9QLgv|YhEkdP6C)7PKQ47pGbWk6oP!V*cI1`gy847|q8&D=>E;#=Easgnv9BE4T R;1U1;002ovPDHLkV1n{+FF61J diff --git a/homedecor/textures/homedecor_glowlight_thick_sides.png b/homedecor/textures/homedecor_glowlight_thick_sides.png index a7dbd085e423299f1f14423a7971fe0ec773a0ac..81a9518478bbe61f78576ad5091f649764150122 100644 GIT binary patch delta 145 zcmV;C0B--X0j&X$B!6^CL_t&-(_N1-5&{7T1DB95So!~_+4utsg2jz`Cml(c4fWzW z=5g8Y1}Fq!j|5!>wIU1{muP@dYO%Tzf+$L`T8)5CPoYYkA-i7AO5r>|H-yQ}2^)&sFVSpZm6R$u{~@-BVb|=4*?Pzyni()M)K*%!bn$F!rb-;#kBo}9O){PM0~nk n36lh{fR%Niky=)QqI>5JO1CgQq!sR&00000NkvXXu0mjfg#b6{ delta 144 zcmV;B0B`@I0jvR#B!6>BL_t&-83nh^I7=|gpXgi;3}bBM?QB94G~RGnBI^{Nho y?yg?91GMfg9vzUt-CeH}Qj5Fm^{b*#RR1f(RY}Crt#$wa00{s|MNUMnLSTZ5y+QT>