minetest-mm/mods/plantlife_modpack/pl_sunflowers/init.lua

58 lines
1.3 KiB
Lua
Raw Normal View History

2021-12-27 15:08:16 +01:00
-- support for i18n
local S = minetest.get_translator("pl_sunflowers")
2024-12-19 12:55:40 +01:00
local sunflower_rarity = minetest.settings:get("pl_sunflowers.sunflower_rarity") or 0.005
2021-12-27 15:08:16 +01:00
local box = {
type="fixed",
fixed = { { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },
}
local sunflower_drop = "farming:seed_wheat"
if minetest.registered_items["farming:seed_spelt"] then
sunflower_drop = "farming:seed_spelt"
end
minetest.register_node(":flowers:sunflower", {
description = S("Sunflower"),
drawtype = "mesh",
paramtype = "light",
2024-12-19 12:55:40 +01:00
paramtype2 = "degrotate",
2021-12-27 15:08:16 +01:00
inventory_image = "flowers_sunflower_inv.png",
mesh = "flowers_sunflower.obj",
tiles = { "flowers_sunflower.png" },
2024-12-19 12:55:40 +01:00
use_texture_alpha = "clip",
2021-12-27 15:08:16 +01:00
walkable = false,
buildable_to = true,
is_ground_content = true,
groups = { dig_immediate=3, flora=1, flammable=3, attached_node=1 },
sounds = default.node_sound_leaves_defaults(),
selection_box = box,
collision_box = box,
drop = {
max_items = 1,
items = {
{items = {sunflower_drop}, rarity = 8},
{items = {"flowers:sunflower"}},
}
}
})
2024-12-19 12:55:40 +01:00
minetest.register_decoration({
decoration = {
"flowers:sunflower"
},
fill_ratio = sunflower_rarity,
y_min = 1,
y_max = 40,
param2 = 0,
param2_max = 239,
place_on = {
"default:dirt_with_grass"
2021-12-27 15:08:16 +01:00
},
2024-12-19 12:55:40 +01:00
deco_type = "simple",
flags = "all_floors",
})
2021-12-27 15:08:16 +01:00
minetest.register_alias("sunflower:sunflower", "flowers:sunflower")