From 0dca0d377ee246dfeb16031beb384b93926bed99 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 21 Jul 2016 12:15:41 +0200 Subject: [PATCH] Add all nodes to new colorcube group --- init.lua | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index c28c204..413f4be 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ cc.human_colors = { white = "white", yellow = "yellow", orange = "orange", red = local light_level = 14 local soundmaker = function (mod) - if stepgain == nil then stepgain = 0 end + if mod == nil then mod = 0 end local scrub = function(value) return math.min(1, math.max(value, 0)) @@ -19,6 +19,16 @@ local soundmaker = function (mod) place = { name = "colorcubes_block_place", gain = 0.5 }, } end +--[[ +Color Cubes groups for better identification: +colorcube~=0: this item is a color cube +colorcube=1: basic +colorcube=2: window +colorcube=3: tile +colorcube=4: concentric +colorcube=5: light +]] + for i=1,#cc.colors do local c = cc.colors[i] local h = cc.human_colors[c] @@ -27,7 +37,7 @@ for i=1,#cc.colors do local nodedef1 = { description = h.." basic color cube", tiles = { "colorcubes_1_"..c..".png" }, - groups = { dig_immediate = 2 }, + groups = { dig_immediate = 2, colorcube = 1 }, sounds = soundmaker(0), } minetest.register_node("colorcubes:"..c.."_single", nodedef1) @@ -36,7 +46,7 @@ for i=1,#cc.colors do description = h.." window color cube", tiles = { "colorcubes_window_"..c..".png" }, inventory_image = minetest.inventorycube("colorcubes_window_"..c..".png"), - groups = { dig_immediate = 2 }, + groups = { dig_immediate = 2, colorcube = 2 }, use_texture_alpha = true, drawtype = "glasslike", sunlight_propagates = true, @@ -48,7 +58,7 @@ for i=1,#cc.colors do local nodedef4 = { description = h.." tiled color cube", tiles = { "colorcubes_4_"..c..".png" }, - groups = { dig_immediate = 2 }, + groups = { dig_immediate = 2, colorcube = 3 }, sounds = soundmaker(0.1), } minetest.register_node("colorcubes:"..c.."_tiled", nodedef4) @@ -56,7 +66,7 @@ for i=1,#cc.colors do local nodedef_inward = { description = h.." concentric color cube", tiles = { "colorcubes_inward_"..c..".png" }, - groups = { dig_immediate = 2 }, + groups = { dig_immediate = 2, colorcube = 4 }, sounds = soundmaker(0.15), } minetest.register_node("colorcubes:"..c.."_inward", nodedef_inward) @@ -65,7 +75,7 @@ for i=1,#cc.colors do local nodedef_light = { description = h.." light color cube", tiles = { "colorcubes_light_"..c..".png" }, - groups = { dig_immediate = 2 }, + groups = { dig_immediate = 2, colorcube = 5 }, sounds = soundmaker(-0.05), light_source = light_level, } @@ -130,7 +140,7 @@ for i=1,#complementary do minetest.register_node(nodeid, { description = complementary_names[i], tiles = { tex, tex, tex, tex, texR90, texR90 }, - groups = { dig_immediate = 2 }, + groups = { dig_immediate = 2, colorcube = 3 }, sounds = soundmaker(0.1), }) -- 2.11.4.GIT