From 68151c9d1161d275f3f6afe7d922d0cbe034eed3 Mon Sep 17 00:00:00 2001 From: D00Med Date: Mon, 22 May 2017 13:27:30 +1000 Subject: [PATCH] lantern glow --- mods/decoblocks/lantern.lua | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/mods/decoblocks/lantern.lua b/mods/decoblocks/lantern.lua index 0d511de..4d01153 100644 --- a/mods/decoblocks/lantern.lua +++ b/mods/decoblocks/lantern.lua @@ -83,20 +83,23 @@ minetest.register_node("decoblocks:lantern", { }) minetest.register_abm({ - nodenames = {"decoblocks:lantern"}, + nodenames = {"decoblocks:lantern", "decoblocks:lantern_ceiling"}, interval = 5, chance = 1, action = function(pos, node) + if minetest.get_timeofday() <= 0.6 and minetest.get_timeofday() >= 0.2 then + return + end minetest.add_particle({ pos = {x=pos.x, y=pos.y, z=pos.z}, velocity = {x=0, y=0, z=0}, acceleration = {x=0, y=0, z=0}, expirationtime = 5, - size = 25, + size = 15, collisiondetection = false, collisionremoval = false, vertical = true, - texture = "decoblocks_glow.png", + texture = "mapgen_glow.png", animation = {type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 2.00}, glow = 9 }) @@ -124,6 +127,31 @@ minetest.register_node("decoblocks:lantern_wall", { sounds = default.node_sound_wood_defaults(), }) +minetest.register_abm({ + nodenames = {"decoblocks:lantern_wall"}, + interval = 5, + chance = 1, + action = function(pos, node) + if minetest.get_timeofday() <= 0.6 and minetest.get_timeofday() >= 0.2 then + return + end + local dir = minetest.facedir_to_dir(node.param2) + minetest.add_particle({ + pos = {x=pos.x-0.35*dir.z, y=pos.y-0.1, z=pos.z-0.35*dir.x}, + velocity = {x=0, y=0, z=0}, + acceleration = {x=0, y=0, z=0}, + expirationtime = 5, + size = 15, + collisiondetection = false, + collisionremoval = false, + vertical = true, + texture = "mapgen_glow.png", + animation = {type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 0.20}, + glow = 9 + }) + end +}) + minetest.register_node("decoblocks:lantern_ceiling", { drawtype = "mesh", mesh = "lantern_ceiling.obj",