Rename all the blocks

master
Wuzzy 2016-07-03 20:52:12 +02:00
parent 958bf1b6f0
commit cfef0358a6
1 changed files with 18 additions and 11 deletions

View File

@ -23,14 +23,17 @@ for i=1,#cc.colors do
local c = cc.colors[i]
local h = cc.human_colors[c]
local d = cc.dye_colors[c]
-- Blocks with a simple square pattern
local nodedef1 = {
description = h.." abstract block",
description = h.." basic color cube",
tiles = { "colorcubes_1_"..c..".png" },
groups = { dig_immediate = 2 },
sounds = soundmaker(0),
}
minetest.register_node("colorcubes:"..c.."_single", nodedef1)
-- Windows
local nodedef_window = {
description = h.." abstract window block",
description = h.." window color cube",
tiles = { "colorcubes_window_"..c..".png" },
inventory_image = minetest.inventorycube("colorcubes_window_"..c..".png"),
groups = { dig_immediate = 2 },
@ -40,21 +43,27 @@ for i=1,#cc.colors do
paramtype = "light",
sounds = soundmaker(-0.1),
}
minetest.register_node("colorcubes:"..c.."_window", nodedef_window)
-- Blocks with a tile pattern (4 tiles)
local nodedef4 = {
description = h.." tiled abstract block",
description = h.." tiled color cube",
tiles = { "colorcubes_4_"..c..".png" },
groups = { dig_immediate = 2 },
sounds = soundmaker(0.1),
}
minetest.register_node("colorcubes:"..c.."_tiled", nodedef4)
-- Blocks with a concentric square pattern
local nodedef_inward = {
description = h.." inward abstract block",
description = h.." concentric color cube",
tiles = { "colorcubes_inward_"..c..".png" },
groups = { dig_immediate = 2 },
sounds = soundmaker(0.15),
}
minetest.register_node("colorcubes:"..c.."_inward", nodedef_inward)
-- Lamps in different brightness levels
if light_level > 1 then
local nodedef_light = {
description = h.." abstract lamp",
description = h.." light color cube",
tiles = { "colorcubes_light_"..c..".png" },
groups = { dig_immediate = 2 },
sounds = soundmaker(-0.05),
@ -64,11 +73,6 @@ for i=1,#cc.colors do
light_level = light_level - 1
end
minetest.register_node("colorcubes:"..c.."_single", nodedef1)
minetest.register_node("colorcubes:"..c.."_window", nodedef_window)
minetest.register_node("colorcubes:"..c.."_tiled", nodedef4)
minetest.register_node("colorcubes:"..c.."_inward", nodedef_inward)
--[[ If the paint_roller mod is installed, register the nodes to it ]]
if(minetest.get_modpath("paint_roller") ~= nil) then
paint_roller.register_one("colorcubes:"..c.."_single", d, "Simple Abstract Blocks" )
@ -77,6 +81,7 @@ for i=1,#cc.colors do
paint_roller.register_one("colorcubes:"..c.."_window", d, "Abstract Window Block" )
end
-- Register various crafting recipes for convenience
minetest.register_craft({
output = "colorcubes:"..c.."_tiled",
recipe = {
@ -107,8 +112,10 @@ for i=1,#cc.colors do
end
--[[ Tiled blocks with 2 differend colors (usuall complementary colors) ]]
local complementary = { { "yellow", "blue"}, {"aqua", "redviolet"}, {"red", "cyan"}, {"light_gray", "dark_gray"}, {"green", "magenta"}, {"orange", "skyblue"}, {"lime", "violet"}, {"black", "white"}, {"orange", "brown"} }
local complementary_names = { "yellow/blue tiled abstract block", "aqua/red-violet tiled abstract block", "red/cyan tiled abstract block", "light/dark gray tiled abstract block", "green/magenta tiled abstract block", "orange/skyblue tiled abstract block", "lime/violet tiled abstract block", "black/white tiled abstract block", "orange/brown tiled abstract block" }
local complementary_names = { "yellow/blue tiled color cube", "aqua/red-violet tiled color cube", "red/cyan tiled color cube", "light/dark gray tiled color cube", "green/magenta tiled color cube", "orange/skyblue tiled color cube", "lime/violet tiled color cube", "black/white tiled color cube", "orange/brown tiled color cube" }
for i=1,#complementary do
local c1, c2