made node and craftitem names reflect textures

This commit is contained in:
vse bor 2012-07-16 21:55:25 -07:00
parent 429955d6df
commit ca6ac138eb

194
init.lua

@ -43,10 +43,10 @@ HUES = {
"white" "white"
} }
TYPES = { TYPES = {
"_clayblock", "clayblock_",
"_clay", "clay_",
"_brick", "brick_",
"_brickblock" "brickblock_"
} }
SATURATION = { SATURATION = {
"_s50", "_s50",
@ -96,36 +96,36 @@ FORMALDARKNESS = {
} }
register_clay_block = function(name,formalname) register_clay_block = function(name,formalname)
minetest.register_node("unifiedbricks:" .. name .. TYPES[1], { minetest.register_node("unifiedbricks:" .. TYPES[1] .. name, {
description = formalname .. FORMALTYPES[1], description = formalname .. FORMALTYPES[1],
tile_images = {"unifiedbricks" .. TYPES[1] .. name .. ".png"}, tile_images = {"unifiedbricks_" .. TYPES[1] .. name .. ".png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3},
drop = "unifiedbricks:" .. name .. TYPES[2] .. " 4", drop = "unifiedbricks:" .. TYPES[2] .. name .. " 4",
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = "", footstep = "",
}), }),
}) })
end end
register_clay_lump = function(name,formalname) register_clay_lump = function(name,formalname)
minetest.register_craftitem("unifiedbricks:" .. name .. TYPES[2], { minetest.register_craftitem("unifiedbricks:" .. TYPES[2] .. name, {
description = formalname .. FORMALTYPES[2], description = formalname .. FORMALTYPES[2],
inventory_image = "unifiedbricks" .. TYPES[2] .. name .. ".png", inventory_image = "unifiedbricks_" .. TYPES[2] .. name .. ".png",
}) })
end end
register_brick = function(name,formalname) register_brick = function(name,formalname)
minetest.register_craftitem("unifiedbricks:" .. name .. TYPES[3], { minetest.register_craftitem("unifiedbricks:" .. TYPES[3] .. name, {
description = formalname .. FORMALTYPES[3], description = formalname .. FORMALTYPES[3],
inventory_image = "unifiedbricks" .. TYPES[3] .. name .. ".png", inventory_image = "unifiedbricks_" .. TYPES[3] .. name .. ".png",
}) })
end end
register_brick_block = function(name,formalname) register_brick_block = function(name,formalname)
minetest.register_node("unifiedbricks:" .. name .. TYPES[4], { minetest.register_node("unifiedbricks:" .. TYPES[4] .. name, {
description = formalname .. FORMALTYPES[4], description = formalname .. FORMALTYPES[4],
tile_images = {"unifiedbricks" .. TYPES[4] .. name .. ".png"}, tile_images = {"unifiedbricks_" .. TYPES[4] .. name .. ".png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3},
drop = "unifiedbricks_" .. name .. TYPES[3] .." 4", drop = "unifiedbricks_" .. TYPES[3] .. name .." 4",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
end end
@ -133,25 +133,25 @@ end
register_clay_craft = function(color_combo,color_one,color_two) register_clay_craft = function(color_combo,color_one,color_two)
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
}, },
}) })
@ -159,63 +159,63 @@ end
register_clay_craft_three = function(color_combo,color_one,color_two,color_three) register_clay_craft_three = function(color_combo,color_one,color_two,color_three)
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 3", output = "unifiedbricks:clay" .. color_combo .. " 3",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
}, },
@ -224,185 +224,185 @@ end
register_clay_craft_three_reducedfat = function(color_combo,color_one,color_two,color_three) register_clay_craft_three_reducedfat = function(color_combo,color_one,color_two,color_three)
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 3", output = "unifiedbricks:clay" .. color_combo .. " 3",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
}, },
}) })
end end
register_clay_craft_four_reducedfat = function(color_combo,color_one,color_two,color_three,color_four) register_clay_craft_four_reducedfat = function(color_combo,color_one,color_two,color_three,color_four)
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 4", output = "unifiedbricks:clay" .. color_combo .. " 4",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
"unifiedbricks:" .. color_four .. "_clay", "unifiedbricks:clay" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 3", output = "unifiedbricks:clay" .. color_combo .. " 3",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
"unifieddyes:" .. color_four, "unifieddyes:" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 3", output = "unifiedbricks:clay" .. color_combo .. " 3",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
"unifiedbricks:" .. color_four .. "_clay", "unifiedbricks:clay" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 3", output = "unifiedbricks:clay" .. color_combo .. " 3",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
"unifiedbricks:" .. color_four .. "_clay", "unifiedbricks:clay" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
"unifieddyes:" .. color_four, "unifieddyes:" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
"unifiedbricks:" .. color_four .. "_clay", "unifiedbricks:clay" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
"unifiedbricks:" .. color_four .. "_clay", "unifiedbricks:clay" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 2", output = "unifiedbricks:clay" .. color_combo .. " 2",
recipe = { recipe = {
"unifiedbricks:" .. color_one .. "_clay", "unifiedbricks:clay" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
"unifieddyes:" .. color_four, "unifieddyes:" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
"unifiedbricks:" .. color_three .. "_clay", "unifiedbricks:clay" .. color_three,
"unifieddyes:" .. color_four, "unifieddyes:" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifiedbricks:" .. color_two .. "_clay", "unifiedbricks:clay" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
"unifieddyes:" .. color_four, "unifieddyes:" .. color_four,
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
type = "shapeless", type = "shapeless",
output = "unifiedbricks:" .. color_combo .. "_clay 1", output = "unifiedbricks:clay" .. color_combo .. " 1",
recipe = { recipe = {
"unifieddyes:" .. color_one, "unifieddyes:" .. color_one,
"unifieddyes:" .. color_two, "unifieddyes:" .. color_two,
"unifieddyes:" .. color_three, "unifieddyes:" .. color_three,
"unifiedbricks:" .. color_four .. "_clay", "unifiedbricks:clay" .. color_four,
}, },
}) })
end end
register_clay_block_craft = function(color) register_clay_block_craft = function(color)
minetest.register_craft({ minetest.register_craft({
output = "unifiedbricks:" .. color .. TYPES[1], output = "unifiedbricks:" .. TYPES[1] .. color,
recipe = { recipe = {
{"unifiedbricks:" .. color .. TYPES[2], "unifiedbricks:" .. color .. TYPES[2]}, {"unifiedbricks:" .. TYPES[2] .. color, "unifiedbricks:" .. TYPES[2] .. color},
{"unifiedbricks:" .. color .. TYPES[2], "unifiedbricks:" .. color .. TYPES[2]}, {"unifiedbricks:" .. TYPES[2] .. color, "unifiedbricks:" .. TYPES[2] .. color},
} }
}) })
end end
register_brick_cooking = function(color) register_brick_cooking = function(color)
minetest.register_craft({ minetest.register_craft({
type = "cooking", type = "cooking",
output = "unifiedbricks:" .. color .. TYPES[3], output = "unifiedbricks:" .. TYPES[3] .. color,
recipe = "unifiedbricks:" .. color .. TYPES[2], recipe = "unifiedbricks:" .. TYPES[2] .. color,
}) })
end end
register_brick_block_craft = function(color) register_brick_block_craft = function(color)
minetest.register_craft({ minetest.register_craft({
output = "unifiedbricks:" .. color .. TYPES[4], output = "unifiedbricks:" .. TYPES[4] .. color,
recipe = { recipe = {
{"unifiedbricks:" .. color .. TYPES[3], "unifiedbricks:" .. color .. TYPES[3]}, {"unifiedbricks:" .. TYPES[3] .. color, "unifiedbricks:" .. TYPES[3] .. color},
{"unifiedbricks:" .. color .. TYPES[3], "unifiedbricks:" .. color .. TYPES[3]}, {"unifiedbricks:" .. TYPES[3] .. color, "unifiedbricks:" .. TYPES[3] .. color},
} }
}) })
end end