2021-04-18 21:54:18 -04:00
|
|
|
local modpath = minetest.get_modpath("fl_stone")
|
|
|
|
dofile(modpath .. "/other.lua")
|
2021-03-22 11:29:28 -04:00
|
|
|
|
2021-05-07 20:25:06 -04:00
|
|
|
local function create_stone_types(name, rgroups, sgroups, blgroups, brgroups)
|
|
|
|
local rgp = rgroups or {oddly_breakable_by_hand = 3, stairable = 1, wallable = 1, stonelike = 1}
|
|
|
|
local sgp = sgroups or {oddly_breakable_by_hand = 3, stairable = 1, wallable = 1, stonelike = 1, stone = 1}
|
|
|
|
local blgp = blgroups or {oddly_breakable_by_hand = 3, stairable = 1, stonelike = 1}
|
|
|
|
local brgp = brgroups or {oddly_breakable_by_hand = 3, stairable = 1, wallable = 1, stonelike = 1}
|
|
|
|
local rn = "fl_stone:" .. name .. "_rubble"
|
2021-03-22 11:29:28 -04:00
|
|
|
|
2021-03-27 23:30:47 -04:00
|
|
|
--node registration
|
2021-04-29 21:39:21 -04:00
|
|
|
minetest.register_node("fl_stone:" .. name .. "_rubble", {
|
2021-03-22 11:29:28 -04:00
|
|
|
description = name .. " rubble",
|
|
|
|
tiles = {"farlands_" .. name .. "_rubble.png"},
|
2021-05-07 20:25:06 -04:00
|
|
|
groups = rgp,
|
2021-03-22 11:29:28 -04:00
|
|
|
})
|
2021-04-29 21:39:21 -04:00
|
|
|
minetest.register_node("fl_stone:" .. name, {
|
2021-03-22 11:29:28 -04:00
|
|
|
description = name,
|
|
|
|
tiles = {"farlands_" .. name .. ".png"},
|
2021-05-07 20:25:06 -04:00
|
|
|
--drop = "fl_stone:" .. name .. "_rubble",
|
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
|
|
|
{items = {rn}}
|
|
|
|
},
|
|
|
|
stairs = {
|
|
|
|
slab = rn .. "_slab",
|
|
|
|
stair = rn .. "_stair",
|
|
|
|
inner_stair = rn .. "_inner_stair",
|
|
|
|
outer_stair = rn .. "_outer_stair",
|
|
|
|
},
|
|
|
|
walls = rn .. "_wall"
|
|
|
|
},
|
2021-06-04 19:55:44 -04:00
|
|
|
--this is to make tnt happy while this is used as a dummy flammable
|
|
|
|
on_construct = function(pos) end,
|
2021-05-07 20:25:06 -04:00
|
|
|
groups = sgp,
|
2021-03-22 11:29:28 -04:00
|
|
|
})
|
2021-04-29 21:39:21 -04:00
|
|
|
minetest.register_node("fl_stone:" .. name .. "_block", {
|
2021-03-22 11:29:28 -04:00
|
|
|
description = name .. " block",
|
|
|
|
tiles = {"farlands_" .. name .. "_block.png"},
|
2021-05-07 20:25:06 -04:00
|
|
|
groups = blgp,
|
2021-03-22 11:29:28 -04:00
|
|
|
})
|
2021-04-29 21:39:21 -04:00
|
|
|
minetest.register_node("fl_stone:" .. name .. "_brick", {
|
2021-03-22 11:29:28 -04:00
|
|
|
description = name .. " brick",
|
|
|
|
tiles = {"farlands_" .. name .. "_brick.png"},
|
2021-05-07 20:25:06 -04:00
|
|
|
groups = brgp,
|
2021-03-22 11:29:28 -04:00
|
|
|
})
|
|
|
|
|
2021-03-27 23:30:47 -04:00
|
|
|
--craft registration
|
2021-04-29 21:39:21 -04:00
|
|
|
local coreN = "fl_stone:" .. name
|
2021-03-27 23:30:47 -04:00
|
|
|
minetest.register_craft({
|
2021-04-29 21:39:21 -04:00
|
|
|
output = "fl_stone:" .. name .. "_block",
|
2021-03-27 23:30:47 -04:00
|
|
|
recipe = {
|
|
|
|
{coreN, coreN, coreN},
|
|
|
|
{coreN, coreN, coreN},
|
|
|
|
{coreN, coreN, coreN},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2021-04-29 21:39:21 -04:00
|
|
|
output = "fl_stone:" .. name .. "_brick",
|
2021-03-27 23:30:47 -04:00
|
|
|
recipe = {
|
|
|
|
{coreN, coreN},
|
|
|
|
{coreN, coreN},
|
|
|
|
}
|
|
|
|
})
|
2021-04-29 21:39:21 -04:00
|
|
|
|
|
|
|
minetest.register_alias("fl_terrain:" .. name .. "_rubble", "fl_stone:" .. name .. "_rubble")
|
|
|
|
minetest.register_alias("fl_terrain:" .. name, "fl_stone:" .. name)
|
|
|
|
minetest.register_alias("fl_terrain:" .. name .. "_block", "fl_stone:" .. name .. "_block")
|
|
|
|
minetest.register_alias("fl_terrain:" .. name .. "_brick", "fl_stone:" .. name .. "_brick")
|
2021-03-22 11:29:28 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
create_stone_types("stone")
|
|
|
|
create_stone_types("ors")
|
|
|
|
create_stone_types("tuff")
|
|
|
|
create_stone_types("basalt")
|
|
|
|
create_stone_types("gneiss")
|
|
|
|
create_stone_types("desert_stone")
|