mirror of
https://github.com/mt-mods/coloredwood.git
synced 2024-11-13 06:00:22 +01:00
local-ize a bunch of variables and tables
This commit is contained in:
parent
7e7a562351
commit
a9a6003bbd
86
fence.lua
86
fence.lua
|
@ -3,13 +3,13 @@
|
|||
--
|
||||
-- License: WTFPL
|
||||
|
||||
colored_block_modname = "coloredwood"
|
||||
colored_block_description = "Wooden Fence"
|
||||
neutral_block = "default:fence_wood"
|
||||
colored_block_sunlight = "false"
|
||||
colored_block_walkable = "true"
|
||||
colored_block_groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1}
|
||||
colored_block_sound = "default.node_sound_wood_defaults()"
|
||||
local colored_block_modname = "coloredwood"
|
||||
local colored_block_description = "Wooden Fence"
|
||||
local neutral_block = "default:fence_wood"
|
||||
local colored_block_sunlight = "false"
|
||||
local colored_block_walkable = "true"
|
||||
local colored_block_groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1}
|
||||
local colored_block_sound = "default.node_sound_wood_defaults()"
|
||||
|
||||
-- ------------------------------------------------------------------
|
||||
-- Generate all of the base color node definitions and all variations
|
||||
|
@ -20,19 +20,19 @@ colored_block_sound = "default.node_sound_wood_defaults()"
|
|||
-- Texture brightness levels for the colors are 100%, 66% ("medium"),
|
||||
-- and 33% ("dark").
|
||||
|
||||
shades = {
|
||||
local shades = {
|
||||
"dark_",
|
||||
"medium_",
|
||||
"" -- represents "no special shade name", e.g. full.
|
||||
}
|
||||
|
||||
shades2 = {
|
||||
local shades2 = {
|
||||
"Dark ",
|
||||
"Medium ",
|
||||
"" -- represents "no special shade name", e.g. full.
|
||||
}
|
||||
|
||||
hues = {
|
||||
local hues = {
|
||||
"red",
|
||||
"orange",
|
||||
"yellow",
|
||||
|
@ -47,7 +47,7 @@ hues = {
|
|||
"redviolet"
|
||||
}
|
||||
|
||||
hues2 = {
|
||||
local hues2 = {
|
||||
"Red ",
|
||||
"Orange ",
|
||||
"Yellow ",
|
||||
|
@ -62,7 +62,7 @@ hues2 = {
|
|||
"Red-violet "
|
||||
}
|
||||
|
||||
greys = {
|
||||
local greys = {
|
||||
"black",
|
||||
"darkgrey",
|
||||
"grey",
|
||||
|
@ -70,7 +70,7 @@ greys = {
|
|||
"white"
|
||||
}
|
||||
|
||||
greys2 = {
|
||||
local greys2 = {
|
||||
"Black ",
|
||||
"Dark Grey ",
|
||||
"Medium Grey ",
|
||||
|
@ -78,7 +78,7 @@ greys2 = {
|
|||
"White "
|
||||
}
|
||||
|
||||
greys3 = {
|
||||
local greys3 = {
|
||||
"black",
|
||||
"darkgrey_paint",
|
||||
"mediumgrey_paint",
|
||||
|
@ -88,25 +88,25 @@ greys3 = {
|
|||
|
||||
for shade = 1, 3 do
|
||||
|
||||
shadename = shades[shade]
|
||||
shadename2 = shades2[shade]
|
||||
local shadename = shades[shade]
|
||||
local shadename2 = shades2[shade]
|
||||
|
||||
for hue = 1, 12 do
|
||||
|
||||
huename = hues[hue]
|
||||
huename2 = hues2[hue]
|
||||
local huename = hues[hue]
|
||||
local huename2 = hues2[hue]
|
||||
|
||||
colorname = colored_block_modname..":fence_"..shadename..huename
|
||||
pngnameinv = colored_block_modname.."_fence_"..shadename..huename..".png"
|
||||
pngname = colored_block_modname.."_wood_"..shadename..huename..".png"
|
||||
nodedesc = shadename2..huename2..colored_block_description
|
||||
stickname = colored_block_modname..":stick_"..shadename..huename
|
||||
local colorname = colored_block_modname..":fence_"..shadename..huename
|
||||
local pngnameinv = colored_block_modname.."_fence_"..shadename..huename..".png"
|
||||
local pngname = colored_block_modname.."_wood_"..shadename..huename..".png"
|
||||
local nodedesc = shadename2..huename2..colored_block_description
|
||||
local stickname = colored_block_modname..":stick_"..shadename..huename
|
||||
|
||||
s50colorname = colored_block_modname..":fence_"..shadename..huename.."_s50"
|
||||
s50pngname = colored_block_modname.."_wood_"..shadename..huename.."_s50.png"
|
||||
s50pngnameinv = colored_block_modname.."_fence_"..shadename..huename.."_s50.png"
|
||||
s50nodedesc = shadename2..huename2..colored_block_description.." (50% Saturation)"
|
||||
s50stickname = colored_block_modname..":stick_"..shadename..huename.."_s50"
|
||||
local s50colorname = colored_block_modname..":fence_"..shadename..huename.."_s50"
|
||||
local s50pngname = colored_block_modname.."_wood_"..shadename..huename.."_s50.png"
|
||||
local s50pngnameinv = colored_block_modname.."_fence_"..shadename..huename.."_s50.png"
|
||||
local s50nodedesc = shadename2..huename2..colored_block_description.." (50% Saturation)"
|
||||
local s50stickname = colored_block_modname..":stick_"..shadename..huename.."_s50"
|
||||
|
||||
minetest.register_node(colorname, {
|
||||
drawtype = "fencelike",
|
||||
|
@ -218,13 +218,13 @@ end
|
|||
-- Generate the "light" shades separately, since they don"t have a low-sat version.
|
||||
|
||||
for hue = 1, 12 do
|
||||
huename = hues[hue]
|
||||
huename2 = hues2[hue]
|
||||
colorname = colored_block_modname..":fence_light_"..huename
|
||||
pngname = colored_block_modname.."_wood_light_"..huename..".png"
|
||||
pngnameinv = colored_block_modname.."_fence_light_"..huename..".png"
|
||||
nodedesc = "Light "..huename2..colored_block_description
|
||||
stickname = colored_block_modname..":stick_light_"..shadename..huename
|
||||
local huename = hues[hue]
|
||||
local huename2 = hues2[hue]
|
||||
local colorname = colored_block_modname..":fence_light_"..huename
|
||||
local pngname = colored_block_modname.."_wood_light_"..huename..".png"
|
||||
local pngnameinv = colored_block_modname.."_fence_light_"..huename..".png"
|
||||
local nodedesc = "Light "..huename2..colored_block_description
|
||||
local stickname = colored_block_modname..":stick_light_"..huename
|
||||
|
||||
minetest.register_node(colorname, {
|
||||
drawtype = "fencelike",
|
||||
|
@ -289,15 +289,15 @@ end
|
|||
|
||||
for grey = 1,5 do
|
||||
|
||||
greyname = greys[grey]
|
||||
greyname2 = greys2[grey]
|
||||
greyname3 = greys3[grey]
|
||||
local greyname = greys[grey]
|
||||
local greyname2 = greys2[grey]
|
||||
local greyname3 = greys3[grey]
|
||||
|
||||
greyshadename = colored_block_modname..":fence_"..greyname
|
||||
pngname = colored_block_modname.."_wood_"..greyname..".png"
|
||||
pngnameinv = colored_block_modname.."_fence_"..greyname..".png"
|
||||
nodedesc = greyname2..colored_block_description
|
||||
stickname = colored_block_modname..":stick_"..greyname
|
||||
local greyshadename = colored_block_modname..":fence_"..greyname
|
||||
local pngname = colored_block_modname.."_wood_"..greyname..".png"
|
||||
local pngnameinv = colored_block_modname.."_fence_"..greyname..".png"
|
||||
local nodedesc = greyname2..colored_block_description
|
||||
local stickname = colored_block_modname..":stick_"..greyname
|
||||
|
||||
minetest.register_node(greyshadename, {
|
||||
drawtype = "fencelike",
|
||||
|
|
70
stick.lua
70
stick.lua
|
@ -3,9 +3,9 @@
|
|||
--
|
||||
-- License: WTFPL
|
||||
|
||||
colored_block_modname = "coloredwood"
|
||||
colored_block_description = "Stick"
|
||||
neutral_block = "default:stick"
|
||||
local colored_block_modname = "coloredwood"
|
||||
local colored_block_description = "Stick"
|
||||
local neutral_block = "default:stick"
|
||||
|
||||
-- ------------------------------------------------------------------
|
||||
-- Generate all of the base color node definitions and all variations
|
||||
|
@ -16,19 +16,19 @@ neutral_block = "default:stick"
|
|||
-- Texture brightness levels for the colors are 100%, 66% ("medium"),
|
||||
-- and 33% ("dark").
|
||||
|
||||
shades = {
|
||||
local shades = {
|
||||
"dark_",
|
||||
"medium_",
|
||||
"" -- represents "no special shade name", e.g. bright.
|
||||
}
|
||||
|
||||
shades2 = {
|
||||
local shades2 = {
|
||||
"Dark ",
|
||||
"Medium ",
|
||||
"" -- represents "no special shade name", e.g. bright.
|
||||
}
|
||||
|
||||
hues = {
|
||||
local hues = {
|
||||
"red",
|
||||
"orange",
|
||||
"yellow",
|
||||
|
@ -43,7 +43,7 @@ hues = {
|
|||
"redviolet"
|
||||
}
|
||||
|
||||
hues2 = {
|
||||
local hues2 = {
|
||||
"Red ",
|
||||
"Orange ",
|
||||
"Yellow ",
|
||||
|
@ -58,7 +58,7 @@ hues2 = {
|
|||
"Red-violet "
|
||||
}
|
||||
|
||||
greys = {
|
||||
local greys = {
|
||||
"black",
|
||||
"darkgrey",
|
||||
"grey",
|
||||
|
@ -66,7 +66,7 @@ greys = {
|
|||
"white"
|
||||
}
|
||||
|
||||
greys2 = {
|
||||
local greys2 = {
|
||||
"Black ",
|
||||
"Dark Grey ",
|
||||
"Medium Grey ",
|
||||
|
@ -74,7 +74,7 @@ greys2 = {
|
|||
"White "
|
||||
}
|
||||
|
||||
greys3 = {
|
||||
local greys3 = {
|
||||
"black",
|
||||
"darkgrey_paint",
|
||||
"mediumgrey_paint",
|
||||
|
@ -84,22 +84,22 @@ greys3 = {
|
|||
|
||||
for shade = 1, 3 do
|
||||
|
||||
shadename = shades[shade]
|
||||
shadename2 = shades2[shade]
|
||||
local shadename = shades[shade]
|
||||
local shadename2 = shades2[shade]
|
||||
|
||||
for hue = 1, 12 do
|
||||
|
||||
huename = hues[hue]
|
||||
huename2 = hues2[hue]
|
||||
local huename = hues[hue]
|
||||
local huename2 = hues2[hue]
|
||||
|
||||
colorname = colored_block_modname..":stick_"..shadename..huename
|
||||
pngname = colored_block_modname.."_stick_"..shadename..huename..".png"
|
||||
itemdesc = shadename2..huename2..colored_block_description
|
||||
woodname = colored_block_modname..":wood_"..shadename..huename
|
||||
s50colorname = colored_block_modname..":stick_"..shadename..huename.."_s50"
|
||||
s50pngname = colored_block_modname.."_stick_"..shadename..huename.."_s50.png"
|
||||
s50itemdesc = shadename2..huename2..colored_block_description.." (50% Saturation)"
|
||||
s50woodkname = colored_block_modname..":wood_"..shadename..huename.."_s50"
|
||||
local colorname = colored_block_modname..":stick_"..shadename..huename
|
||||
local pngname = colored_block_modname.."_stick_"..shadename..huename..".png"
|
||||
local itemdesc = shadename2..huename2..colored_block_description
|
||||
local woodname = colored_block_modname..":wood_"..shadename..huename
|
||||
local s50colorname = colored_block_modname..":stick_"..shadename..huename.."_s50"
|
||||
local s50pngname = colored_block_modname.."_stick_"..shadename..huename.."_s50.png"
|
||||
local s50itemdesc = shadename2..huename2..colored_block_description.." (50% Saturation)"
|
||||
local s50woodkname = colored_block_modname..":wood_"..shadename..huename.."_s50"
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
|
@ -147,12 +147,12 @@ end
|
|||
-- Generate the "light" shades separately, since they don"t have a low-sat version.
|
||||
|
||||
for hue = 1, 12 do
|
||||
huename = hues[hue]
|
||||
huename2 = hues2[hue]
|
||||
colorname = colored_block_modname..":stick_light_"..huename
|
||||
pngname = colored_block_modname.."_stick_light_"..huename..".png"
|
||||
itemdesc = "Light "..huename2..colored_block_description
|
||||
woodname = colored_block_modname..":wood_light_"..huename
|
||||
local huename = hues[hue]
|
||||
local huename2 = hues2[hue]
|
||||
local colorname = colored_block_modname..":stick_light_"..huename
|
||||
local pngname = colored_block_modname.."_stick_light_"..huename..".png"
|
||||
local itemdesc = "Light "..huename2..colored_block_description
|
||||
local woodname = colored_block_modname..":wood_light_"..huename
|
||||
|
||||
minetest.register_craftitem(colorname, {
|
||||
description = itemdesc,
|
||||
|
@ -185,14 +185,14 @@ end
|
|||
|
||||
for grey = 1,5 do
|
||||
|
||||
greyname = greys[grey]
|
||||
greyname2 = greys2[grey]
|
||||
greyname3 = greys3[grey]
|
||||
local greyname = greys[grey]
|
||||
local greyname2 = greys2[grey]
|
||||
local greyname3 = greys3[grey]
|
||||
|
||||
greyshadename = colored_block_modname..":stick_"..greyname
|
||||
pngname = colored_block_modname.."_stick_"..greyname..".png"
|
||||
itemdesc = greyname2..colored_block_description
|
||||
greywoodname = colored_block_modname..":wood_"..greyname
|
||||
local greyshadename = colored_block_modname..":stick_"..greyname
|
||||
local pngname = colored_block_modname.."_stick_"..greyname..".png"
|
||||
local itemdesc = greyname2..colored_block_description
|
||||
local greywoodname = colored_block_modname..":wood_"..greyname
|
||||
|
||||
minetest.register_craftitem(greyshadename, {
|
||||
description = itemdesc,
|
||||
|
|
69
wood.lua
69
wood.lua
|
@ -3,13 +3,13 @@
|
|||
--
|
||||
-- License: WTFPL
|
||||
|
||||
colored_block_modname = "coloredwood"
|
||||
colored_block_description = "Wood Planks"
|
||||
neutral_block = "default:wood"
|
||||
colored_block_sunlight = "false"
|
||||
colored_block_walkable = "true"
|
||||
colored_block_groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1}
|
||||
colored_block_sound = "default.node_sound_wood_defaults()"
|
||||
local colored_block_modname = "coloredwood"
|
||||
local colored_block_description = "Wood Planks"
|
||||
local neutral_block = "default:wood"
|
||||
local colored_block_sunlight = "false"
|
||||
local colored_block_walkable = "true"
|
||||
local colored_block_groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1}
|
||||
local colored_block_sound = "default.node_sound_wood_defaults()"
|
||||
|
||||
-- ------------------------------------------------------------------
|
||||
-- Generate all of the base color node definitions and all variations
|
||||
|
@ -20,19 +20,19 @@ colored_block_sound = "default.node_sound_wood_defaults()"
|
|||
-- Texture brightness levels for the colors are 100%, 66% ("medium"),
|
||||
-- and 33% ("dark").
|
||||
|
||||
shades = {
|
||||
local shades = {
|
||||
"dark_",
|
||||
"medium_",
|
||||
"" -- represents "no special shade name", e.g. bright.
|
||||
}
|
||||
|
||||
shades2 = {
|
||||
local shades2 = {
|
||||
"Dark ",
|
||||
"Medium ",
|
||||
"" -- represents "no special shade name", e.g. bright.
|
||||
}
|
||||
|
||||
hues = {
|
||||
local hues = {
|
||||
"red",
|
||||
"orange",
|
||||
"yellow",
|
||||
|
@ -47,7 +47,7 @@ hues = {
|
|||
"redviolet"
|
||||
}
|
||||
|
||||
hues2 = {
|
||||
local hues2 = {
|
||||
"Red ",
|
||||
"Orange ",
|
||||
"Yellow ",
|
||||
|
@ -62,7 +62,7 @@ hues2 = {
|
|||
"Red-violet "
|
||||
}
|
||||
|
||||
greys = {
|
||||
local greys = {
|
||||
"black",
|
||||
"darkgrey",
|
||||
"grey",
|
||||
|
@ -70,7 +70,7 @@ greys = {
|
|||
"white"
|
||||
}
|
||||
|
||||
greys2 = {
|
||||
local greys2 = {
|
||||
"Black ",
|
||||
"Dark Grey ",
|
||||
"Medium Grey ",
|
||||
|
@ -88,20 +88,20 @@ greys3 = {
|
|||
|
||||
for shade = 1, 3 do
|
||||
|
||||
shadename = shades[shade]
|
||||
shadename2 = shades2[shade]
|
||||
local shadename = shades[shade]
|
||||
local shadename2 = shades2[shade]
|
||||
|
||||
for hue = 1, 12 do
|
||||
|
||||
huename = hues[hue]
|
||||
huename2 = hues2[hue]
|
||||
local huename = hues[hue]
|
||||
local huename2 = hues2[hue]
|
||||
|
||||
colorname = colored_block_modname..":wood_"..shadename..huename
|
||||
pngname = colored_block_modname.."_wood_"..shadename..huename..".png"
|
||||
nodedesc = shadename2..huename2..colored_block_description
|
||||
s50colorname = colored_block_modname..":wood_"..shadename..huename.."_s50"
|
||||
s50pngname = colored_block_modname.."_wood_"..shadename..huename.."_s50.png"
|
||||
s50nodedesc = shadename2..huename2..colored_block_description.." (50% Saturation)"
|
||||
local colorname = colored_block_modname..":wood_"..shadename..huename
|
||||
local pngname = colored_block_modname.."_wood_"..shadename..huename..".png"
|
||||
local nodedesc = shadename2..huename2..colored_block_description
|
||||
local s50colorname = colored_block_modname..":wood_"..shadename..huename.."_s50"
|
||||
local s50pngname = colored_block_modname.."_wood_"..shadename..huename.."_s50.png"
|
||||
local s50nodedesc = shadename2..huename2..colored_block_description.." (50% Saturation)"
|
||||
|
||||
minetest.register_node(colorname, {
|
||||
description = nodedesc,
|
||||
|
@ -167,11 +167,12 @@ end
|
|||
-- Generate the "light" shades separately, since they don"t have a low-sat version.
|
||||
|
||||
for hue = 1, 12 do
|
||||
huename = hues[hue]
|
||||
huename2 = hues2[hue]
|
||||
colorname = colored_block_modname..":wood_light_"..huename
|
||||
pngname = colored_block_modname.."_wood_light_"..huename..".png"
|
||||
nodedesc = "Light "..huename2..colored_block_description
|
||||
|
||||
local huename = hues[hue]
|
||||
local huename2 = hues2[hue]
|
||||
local colorname = colored_block_modname..":wood_light_"..huename
|
||||
local pngname = colored_block_modname.."_wood_light_"..huename..".png"
|
||||
local nodedesc = "Light "..huename2..colored_block_description
|
||||
|
||||
minetest.register_node(colorname, {
|
||||
description = nodedesc,
|
||||
|
@ -213,13 +214,13 @@ end
|
|||
|
||||
for grey = 1,5 do
|
||||
|
||||
greyname = greys[grey]
|
||||
greyname2 = greys2[grey]
|
||||
greyname3 = greys3[grey]
|
||||
local greyname = greys[grey]
|
||||
local greyname2 = greys2[grey]
|
||||
local greyname3 = greys3[grey]
|
||||
|
||||
greyshadename = colored_block_modname..":wood_"..greyname
|
||||
pngname = colored_block_modname.."_wood_"..greyname..".png"
|
||||
nodedesc = greyname2..colored_block_description
|
||||
local greyshadename = colored_block_modname..":wood_"..greyname
|
||||
local pngname = colored_block_modname.."_wood_"..greyname..".png"
|
||||
local nodedesc = greyname2..colored_block_description
|
||||
|
||||
minetest.register_node(greyshadename, {
|
||||
description = nodedesc,
|
||||
|
|
Loading…
Reference in New Issue
Block a user