From b0f073a6a792a03d09c6d75deac28c559af2796c Mon Sep 17 00:00:00 2001 From: h-v-smacker Date: Thu, 15 Nov 2018 06:51:15 +0300 Subject: flint block --- README.md | 1 + flint_block.lua | 96 ++++++++++++++++++++++++ init.lua | 2 + sandstone_cobble.lua | 6 +- textures/minetest_errata_flint_block.png | Bin 0 -> 530 bytes textures/minetest_errata_flint_block_slab.png | Bin 0 -> 555 bytes textures/minetest_errata_flint_block_stair1.png | Bin 0 -> 544 bytes textures/minetest_errata_flint_block_stair2.png | Bin 0 -> 527 bytes 8 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 flint_block.lua create mode 100644 textures/minetest_errata_flint_block.png create mode 100644 textures/minetest_errata_flint_block_slab.png create mode 100644 textures/minetest_errata_flint_block_stair1.png create mode 100644 textures/minetest_errata_flint_block_stair2.png diff --git a/README.md b/README.md index 116dead..0dc6192 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,4 @@ This mod can borrow some items from other mods (in cases where the whole mod see * paper walls and wooden bars * steel bar and wooden bar doors * sandstone cobble varieties + * flint block diff --git a/flint_block.lua b/flint_block.lua new file mode 100644 index 0000000..d6bf7e4 --- /dev/null +++ b/flint_block.lua @@ -0,0 +1,96 @@ +-- Flint block +-- a good use for otherwise useless item + +local node = { + name = "flint_block", + desc = "Flint Block", + tile = {"minetest_errata_flint_block.png"} +} + +minetest.register_node("minetest_errata:" .. node.name, { + description = node.desc, + tiles = node.tile, + is_ground_content = false, + groups = { cracky = 2 }, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + output = "minetest_errata:" .. node.name, + recipe = { + { "default:flint", "default:flint", "default:flint" }, + { "default:flint", "default:flint", "default:flint" }, + { "default:flint", "default:flint", "default:flint" }, + } +}) + +minetest.register_craft({ + output = "default:flint 9 ", + recipe = { + { "minetest_errata:" .. node.name }, + } +}) + +-- Derivative blocks + + +if stairs and stairs.mod and stairs.mod == "redo" then + + stairs.register_all(node.name, "minetest_errata:" .. node.name, + {cracky = 3}, + node.tile, + node.desc .. " Stair", + node.desc .. " Slab", + default.node_sound_stone_defaults()) + +elseif minetest.global_exists("stairsplus") then + + stairsplus:register_all("minetest_errata", node.name, "minetest_errata:" .. node.name, { + description = node.desc, + tiles = node.tile, + groups = {cracky = 3}, + sounds = default.node_sound_stone_defaults(), + }) + +else + +-- stairs.register_stair_and_slab(node.name, "minetest_errata:" .. node.name, +-- {cracky = 3}, +-- node.tile, +-- node.desc .. " Stair", +-- node.desc .. " Slab", +-- default.node_sound_stone_defaults() +-- ) + + stairs.register_slab(node.name, "minetest_errata:" .. node.name, + { cracky = 2 }, + {"minetest_errata_flint_block.png", + "minetest_errata_flint_block.png", + "minetest_errata_flint_block_slab.png", + "minetest_errata_flint_block_slab.png", + "minetest_errata_flint_block_slab.png", + "minetest_errata_flint_block_slab.png" + }, + node.desc .. " Stair", + default.node_sound_stone_defaults() + ) + stairs.register_stair(node.name, "minetest_errata:" .. node.name, + { cracky = 2 }, + {"minetest_errata_flint_block_slab.png", + "minetest_errata_flint_block.png", + "minetest_errata_flint_block_stair1.png", + "minetest_errata_flint_block_stair2.png", + "minetest_errata_flint_block.png", + "minetest_errata_flint_block_slab.png" + }, + node.desc .. " Slab", + default.node_sound_stone_defaults() + ) + +end + + +-- procedurally-generated arcs +if minetest.get_modpath("pkarcs") then + pkarcs.register_node("minetest_errata:" .. node.name) +end \ No newline at end of file diff --git a/init.lua b/init.lua index 1248338..2a38a3f 100644 --- a/init.lua +++ b/init.lua @@ -9,6 +9,8 @@ dofile(modpath.."/doors.lua") dofile(modpath.."/sandstone_cobble.lua") +dofile(modpath.."/flint_block.lua") + dofile(modpath.."/missing_groups.lua") dofile(modpath.."/xpanes.lua") diff --git a/sandstone_cobble.lua b/sandstone_cobble.lua index 0640772..0914b40 100644 --- a/sandstone_cobble.lua +++ b/sandstone_cobble.lua @@ -34,7 +34,7 @@ for _,node in ipairs(cobble_table) do {"minetest_errata_" .. node.name .. "_cobble.png"}, node.desc .. " Cobble Stair", node.desc .. " Cobble Slab", - default.node_sound_wood_defaults()) + default.node_sound_stone_defaults()) elseif minetest.global_exists("stairsplus") then @@ -42,7 +42,7 @@ for _,node in ipairs(cobble_table) do description = node.desc .. " Cobble", tiles = {"minetest_errata_" .. node.name .. "_cobble.png"}, groups = {cracky = 3}, - sounds = default.node_sound_wood_defaults(), + sounds = default.node_sound_stone_defaults(), }) else @@ -52,7 +52,7 @@ for _,node in ipairs(cobble_table) do {"minetest_errata_" .. node.name .. "_cobble.png"}, node.desc .. " Cobble Stair", node.desc .. " Cobble Slab", - default.node_sound_wood_defaults()) + default.node_sound_stone_defaults()) end diff --git a/textures/minetest_errata_flint_block.png b/textures/minetest_errata_flint_block.png new file mode 100644 index 0000000..4f9cd22 Binary files /dev/null and b/textures/minetest_errata_flint_block.png differ diff --git a/textures/minetest_errata_flint_block_slab.png b/textures/minetest_errata_flint_block_slab.png new file mode 100644 index 0000000..bb01368 Binary files /dev/null and b/textures/minetest_errata_flint_block_slab.png differ diff --git a/textures/minetest_errata_flint_block_stair1.png b/textures/minetest_errata_flint_block_stair1.png new file mode 100644 index 0000000..0079f65 Binary files /dev/null and b/textures/minetest_errata_flint_block_stair1.png differ diff --git a/textures/minetest_errata_flint_block_stair2.png b/textures/minetest_errata_flint_block_stair2.png new file mode 100644 index 0000000..941f5b2 Binary files /dev/null and b/textures/minetest_errata_flint_block_stair2.png differ -- cgit v1.2.3