From 89140c8c0e9dbcfc2fee590ef8d912382ae31bde Mon Sep 17 00:00:00 2001 From: Ginger Pollard Date: Tue, 23 Dec 2014 01:13:53 -0500 Subject: [PATCH] added light to the tree :D --- init.lua | 26 ++++++++++++++++++++++++-- textures/xmas_lights.png | Bin 0 -> 280 bytes 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 textures/xmas_lights.png diff --git a/init.lua b/init.lua index 608ed0a..2f04964 100644 --- a/init.lua +++ b/init.lua @@ -4,6 +4,7 @@ function grow_tree(data, a, pos) local c_ignore = minetest.get_content_id("ignore") local c_tree = minetest.get_content_id("default:tree") local c_leaves = minetest.get_content_id("xmas:leaves") + local c_lights = minetest.get_content_id("xmas:leaves_lit") local c_star = minetest.get_content_id("xmas:star") local x, y, z = pos.x, pos.y, pos.z for yy = y, y+18 do @@ -31,7 +32,11 @@ function grow_tree(data, a, pos) local c_ball = minetest.get_content_id("xmas:ball_"..math.random(1,4)) data[vi] = c_ball else - data[vi] = c_leaves + if math.random(1, 100) <= 20 then + data[vi] = c_lights + else + data[vi] = c_leaves + end end end end @@ -77,7 +82,7 @@ minetest.register_node("xmas:sapling", { }) minetest.register_node("xmas:leaves", { - description = "Jungle Leaves", + description = "Leaves", drawtype = "plantlike", visual_scale = 1.5, tiles = {"xmas_leaves.png"}, @@ -92,6 +97,23 @@ minetest.register_node("xmas:leaves", { sounds = default.node_sound_leaves_defaults(), }) +minetest.register_node("xmas:leaves_lit", { + description = "Leaves", + drawtype = "plantlike", + visual_scale = 1.5, + tiles = {"xmas_leaves.png^xmas_lights.png"}, + paramtype = "light", + light_source = 14, + waving = 1, + buildable_to = true, + walkable = false, + climbable = true, + is_ground_content = false, + groups = {snappy=3,leafdecay=13,flammable=2,not_in_creative_inventory=1}, + drop = "", + sounds = default.node_sound_leaves_defaults(), +}) + minetest.register_node("xmas:ball_1", { description = "Xmas Ball Red", mesh = "ball.obj", diff --git a/textures/xmas_lights.png b/textures/xmas_lights.png new file mode 100644 index 0000000000000000000000000000000000000000..d0dd1a8f9992c583286789f7eca61ba1b3167251 GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv(Ey(i*ZiW~|3J3c|Njhs82)Sh zzsK~bp9zYIffk$L90|U1(2s1Lwnj--e z?DuqW4AD4WI&q_5gMt7Hzhm;-0~?vra}FF}@;TG_W^Xoae|qJPph1t8uXs3P@5JxGq58nJ7}4H%L(2}{%H)`rp5_;SUI=m z=R^BM@6tPOdiXDfIhE|Wl_~u4gWt>)4%wBD7hKBGGJJjW&dpz~m#;G$yzJI1N#&ZO Sa{f2Ss|=p5elF{r5}E+j=xS>K literal 0 HcmV?d00001