2021-08-01 22:36:44 -04:00
|
|
|
local function reg_grass(name)
|
|
|
|
local desc = string.split(name, "_")
|
2021-08-28 21:46:01 -04:00
|
|
|
local groups = {dig_generic = 4, plant = 1, not_in_creative_inventory = 1}
|
2021-08-01 22:36:44 -04:00
|
|
|
for i=1, 5 do
|
|
|
|
minetest.register_node("fl_plantlife:" .. name .. "_" .. i, {
|
|
|
|
description = table.concat(desc, " "),
|
|
|
|
drawtype = "plantlike",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "degrotate",
|
|
|
|
tiles = {"[combine:16x16:0," .. 10 - 2*i .. "=farlands_" .. name .. "_plant.png"},
|
|
|
|
floodable = true,
|
|
|
|
on_flood = function(pos, oldnode, newnode)
|
|
|
|
minetest.dig_node(pos)
|
|
|
|
end,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5,-0.5,-0.5,0.5,-0.45,0.5},
|
|
|
|
},
|
|
|
|
walkable = false,
|
2022-03-18 21:20:19 -04:00
|
|
|
buildable_to = true,
|
2021-08-01 22:36:44 -04:00
|
|
|
frop = "fl_plantlife:" .. name .. "_5",
|
|
|
|
groups = groups,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
minetest.override_item("fl_plantlife:" .. name .. "_5", {
|
|
|
|
inventory_image = "[combine:16x16:0,4=farlands_" .. name .. "_plant.png",
|
2021-08-28 21:46:01 -04:00
|
|
|
groups = {dig_generic = 4, plant = 1, not_in_creative_inventory = 0}
|
2021-08-01 22:36:44 -04:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
reg_grass("grass")
|
|
|
|
reg_grass("savannah_grass")
|