161 lines
3.7 KiB
Lua
161 lines
3.7 KiB
Lua
local beautiflowers = {}
|
|
|
|
beautiflowers.flowers ={
|
|
|
|
{"bonsai_1","green"},
|
|
{"bonsai_2","brown"},
|
|
{"bonsai_3","green"},
|
|
{"bonsai_4","brown"},
|
|
{"bonsai_5","green"},
|
|
{"bonsai_5","green"},
|
|
{"pasto_1","dark_green"},
|
|
{"pasto_2","dark_green"},
|
|
{"pasto_3","dark_green"},
|
|
{"pasto_4","dark_green"},
|
|
{"pasto_5","dark_green"},
|
|
{"pasto_6","dark_green"},
|
|
{"pasto_7","dark_green"},
|
|
{"pasto_8","dark_green"},
|
|
{"pasto_9","dark_green"},
|
|
{"pasto_10","dark_green"},
|
|
{"arcoiris","red"},
|
|
{"petunia_1","white"},
|
|
{"petunia_2","white"},
|
|
{"petunia_3","white"},
|
|
{"petunia_4","white"},
|
|
{"petunia_5","white"},
|
|
{"claviola_1","white"},
|
|
{"claviola_2","white"},
|
|
{"claviola_3","white"},
|
|
{"claviola_4","white"},
|
|
{"claviola_5","white"},
|
|
{"claviola_6","white"},
|
|
{"claviola_7","white"},
|
|
{"claviola_8","white"},
|
|
{"rosarela_1","pink"},
|
|
{"rosarela_2","pink"},
|
|
{"rosarela_3","pink"},
|
|
{"rosarela_4","pink"},
|
|
{"rosarela_5","pink"},
|
|
{"rosarela_6","pink"},
|
|
{"rosarela_7","pink"},
|
|
{"rosarela_8","pink"},
|
|
{"rosarela_9","pink"},
|
|
{"rosarela_10","pink"},
|
|
{"rosarela_11","pink"},
|
|
{"rosarela_12","pink"},
|
|
{"violoncia_1","violet"},
|
|
{"violoncia_2","violet"},
|
|
{"violoncia_3","violet"},
|
|
{"violoncia_4","violet"},
|
|
{"violoncia_5","violet"},
|
|
{"violoncia_6","violet"},
|
|
{"violoncia_7","violet"},
|
|
{"violoncia_8","violet"},
|
|
{"violoncia_9","violet"},
|
|
{"violoncia_10","violet"},
|
|
{"violoncia_11","violet"},
|
|
{"skalina_1","cyan"},
|
|
{"skalina_2","cyan"},
|
|
{"skalina_3","cyan"},
|
|
{"skalina_4","cyan"},
|
|
{"skalina_5","cyan"},
|
|
{"skalina_6","cyan"},
|
|
{"skalina_7","cyan"},
|
|
{"skalina_8","cyan"},
|
|
{"azuna_1","blue"},
|
|
{"azuna_2","blue"},
|
|
{"azuna_3","blue"},
|
|
{"azuna_4","blue"},
|
|
{"azuna_5","blue"},
|
|
{"azuna_6","blue"},
|
|
{"azuna_7","blue"},
|
|
{"azuna_8","blue"},
|
|
{"amara_1","yellow"},
|
|
{"amara_2","yellow"},
|
|
{"amara_3","yellow"},
|
|
{"amara_4","yellow"},
|
|
{"amara_5","yellow"},
|
|
{"amara_6","yellow"},
|
|
{"amara_7","yellow"},
|
|
{"naranda_1","orange"},
|
|
{"naranda_2","orange"},
|
|
{"naranda_3","orange"},
|
|
{"naranda_4","orange"},
|
|
{"naranda_5","orange"},
|
|
{"naranda_6","orange"},
|
|
{"naranda_7","orange"},
|
|
{"naranda_8","orange"},
|
|
{"naranda_9","orange"},
|
|
{"naranda_10","orange"},
|
|
{"naranda_11","orange"},
|
|
{"rojiola_1","red"},
|
|
{"rojiola_2","red"},
|
|
{"rojiola_3","red"},
|
|
{"rojiola_4","red"},
|
|
{"rojiola_5","red"},
|
|
{"rojiola_6","red"},
|
|
{"rojiola_7","red"},
|
|
{"rojiola_8","red"},
|
|
{"rojiola_9","red"},
|
|
{"rojiola_10","red"},
|
|
{"rojiola_11","red"},
|
|
{"rojiola_12","red"},
|
|
|
|
}
|
|
|
|
local flowers = beautiflowers.flowers
|
|
|
|
for i = 1, #flowers do
|
|
local name, dye = unpack(flowers[i])
|
|
local desc = unpack(name:split("_"))
|
|
local seed = math.random(100,5000)
|
|
|
|
minetest.register_node("beautiflowers:"..name, {
|
|
description = "Beauty "..desc,
|
|
drawtype = "plantlike",
|
|
waving = 1,
|
|
visual_scale = 1.0,
|
|
tiles = {name..".png"},
|
|
inventory_image = name..".png",
|
|
wield_image = name..".png",
|
|
paramtype = "light",
|
|
sunlight_propagates = true,
|
|
walkable = false,
|
|
buildable_to = true,
|
|
groups = {snappy = 3, flower = 1, flora = 1, attached_node = 1, flammable = 1, beautiflowers = 1},
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
selection_box = {
|
|
type = "fixed",
|
|
fixed = {-2 / 16, -0.5, -2 / 16, 2 / 16, 0, 2 / 16},
|
|
},
|
|
})
|
|
|
|
minetest.register_craft({
|
|
output = "dye:"..dye.." 4",
|
|
recipe = {
|
|
{"beautiflowers:"..name}
|
|
},
|
|
})
|
|
|
|
minetest.register_decoration({
|
|
name = "beautiflowers:"..name,
|
|
deco_type = "simple",
|
|
place_on = {"default:dirt_with_grass","default:dirt","default:dirt_with_coniferous_litter"},
|
|
sidelen = 16,
|
|
noise_params = {
|
|
offset = -0.02,
|
|
scale = 0.04,
|
|
spread = {x = 200, y = 200, z = 200},
|
|
seed = seed,
|
|
octaves = 3,
|
|
persist = 0.6
|
|
},
|
|
biomes = {"grassland", "deciduous_forest"},
|
|
y_max = 31000,
|
|
y_min = 1,
|
|
decoration = "beautiflowers:"..name,
|
|
})
|
|
|
|
end
|