cotton blocks adapted

master
Victor Hackeridze 2012-04-05 15:13:04 +06:00
parent 443388b7dd
commit f0fc4b387d
22 changed files with 118 additions and 0 deletions

View File

@ -0,0 +1,2 @@
dye
flowers

View File

@ -0,0 +1,116 @@
local CB_NAMES_COLORS = {
["white"] = "White cotton block",
["light_gray"] = "Light-gray cotton block",
["gray"] = "Gray cotton block",
["black"] = "Black cotton block",
["red"] = "Red cotton block",
["orange"] = "Orange cotton block",
["yellow"] = "Yellow cotton block",
["lime"] = "Lime cotton block",
["green"] = "Green cotton block",
["light_blue"] = "Light-blue cotton block",
["cyan"] = "Cyan cotton block",
["blue"] = "Blue cotton block",
["purple"] = "Purple cotton block",
["magenta"] = "Magenta cotton block",
["pink"] = "Pink cotton block",
["brown"] = "Brown cotton block",
}
function default.node_sound_cotton_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="cotton_blocks_cotton_step", gain=0.25}
table.dig = table.dig or
{name="cotton_blocks_cotton_step", gain=0.6}
table.dug = table.dug or
{name="", gain=1.0}
default.node_sound_defaults(table)
return table
end
minetest.register_craft({
output = 'cotton_blocks:white',
recipe = {
{'flowers:cotton','flowers:cotton'},
{'flowers:cotton','flowers:cotton'},
}
})
local addCBrecipe = function(new, first, second)
minetest.register_craft({
output = new,
recipe = {
{first, "dye:" .. second},
}
})
minetest.register_craft({
output = new,
recipe = {
{"dye:".. second, "dye:" .. first},
}
})
minetest.register_craft({
output = new,
recipe = {
{first},
{"dye:".. second},
}
})
minetest.register_craft({
output = new,
recipe = {
{"dye:".. second},
{first},
}
})
minetest.register_craft({
output = new,
recipe = {
{"dye:".. second,""},
{"",first},
}
})
minetest.register_craft({
output = new,
recipe = {
{first,""},
{"","dye:".. second},
}
})
minetest.register_craft({
output = new,
recipe = {
{"","dye:".. second},
{first,""},
}
})
minetest.register_craft({
output = new,
recipe = {
{"",first},
{"dye:".. second,""},
}
})
end
for color, name in pairs(CB_NAMES_COLORS) do
minetest.register_node("cotton_blocks:" .. color, {
description = name,
tile_images = {"cb_" .. color .. ".png"},
inventory_image = minetest.inventorycube("cb_" .. color .. ".png"),
is_ground_content = true,
groups = {snappy=3, cotton=1},
sounds = default.node_sound_cotton_defaults(),
stack_max = 128,
})
addCBrecipe("cotton_blocks:" .. color,"cotton_blocks:white",color)
addCBrecipe("cotton_blocks:white","cotton_blocks:" .. color,"white")
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B