diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-10-08 19:34:39 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-10-08 19:34:39 +0100 |
commit | 174cda701850996e3c6b441393346ff18b52e421 (patch) | |
tree | 9931d307ea4b7ea302865d17d6aa6ed7f682091c | |
parent | 20dc8095452829e09aab39dfc318439f0da1adc8 (diff) |
Tidied code, now using minecraft recipe to colour blocks
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | init.lua | 37 |
2 files changed, 25 insertions, 17 deletions
@@ -1,5 +1,6 @@ Baked Clay -This mod for minetest lets the player bake clay into hardened blocks and colour them with dye, stairs and slabs are also available. +This mod lets the player bake clay into hardened blocks and colour them with +dye (8x baked clay and 1x dye in centre), stairs and slabs are also available. -https://forum.minetest.net/viewtopic.php?id=8890
\ No newline at end of file +https://forum.minetest.net/viewtopic.php?id=8890 @@ -1,5 +1,5 @@ --- Baked Clay (0.4) by TenPlus1 +-- Baked Clay (0.5) by TenPlus1 local clay = { {"white", "White"}, @@ -19,31 +19,38 @@ local clay = { {"dark_green", "Dark Green"}, } -for n = 1, #clay do +for _, clay in pairs(clay) do -- node definition - minetest.register_node("bakedclay:" .. clay[n][1], { - description = clay[n][2] .. " Baked Clay", - tiles = {"baked_clay_" .. clay[n][1] ..".png"}, + + minetest.register_node("bakedclay:" .. clay[1], { + description = clay[2] .. " Baked Clay", + tiles = {"baked_clay_" .. clay[1] ..".png"}, groups = {cracky = 3, bakedclay = 1}, sounds = default.node_sound_stone_defaults(), }) -- craft from dye and any baked clay + minetest.register_craft({ - type = "shapeless", - output = "bakedclay:" .. clay[n][1], - recipe = {"dye:" .. clay[n][1], "group:bakedclay"}, + output = "bakedclay:" .. clay[1] .. " 8", + recipe = { + {"group:bakedclay", "group:bakedclay", "group:bakedclay"}, + {"group:bakedclay", "dye:" .. clay[1], "group:bakedclay"}, + {"group:bakedclay", "group:bakedclay", "group:bakedclay"} + }, }) - -- register stair and slab + -- register stair and slab (unless stairs redo active) + if stairs and not stairs.mod then - stairs.register_stair_and_slab("bakedclay_".. clay[n][1], "bakedclay:".. clay[n][1], - {cracky = 3}, - {"baked_clay_" .. clay[n][1] .. ".png"}, - clay[n][2] .. " Baked Clay Stair", - clay[n][2] .. " Baked Clay Slab", - default.node_sound_stone_defaults()) + + stairs.register_stair_and_slab("bakedclay_".. clay[1], "bakedclay:".. clay[1], + {cracky = 3}, + {"baked_clay_" .. clay[1] .. ".png"}, + clay[2] .. " Baked Clay Stair", + clay[2] .. " Baked Clay Slab", + default.node_sound_stone_defaults()) end end |