Add Teosinte plant (Ancestor of corn)

This commit is contained in:
sys4-fr 2017-03-02 16:28:24 +01:00
parent 028d07596f
commit bd7d9afd43
4 changed files with 79 additions and 6 deletions

View File

@ -15,6 +15,7 @@ Optional Dependencies:
For now this mod add:
- Wild carrot: spawn into biomes grassland, deciduous_forest and coniferous_forest.
- Teosinte: spawn into biome rainforest.
- Bunch of flowers:
If farming mod is loaded then you can craft a bunch of flowers with any items from the flower group and a string of cotton.

View File

@ -30,7 +30,36 @@ local function add_simple_flower(name, desc, box, f_groups)
})
end
moreflowers.datas = {
local function add_tall_flower(name, desc, box, f_groups)
f_groups.snappy = 3
f_groups.flower = 1
f_groups.flora = 1
f_groups.attached_node = 1
minetest.register_node("moreflowers:" .. name, {
description = desc,
drawtype = "plantlike",
waving = 1,
tiles = {"moreflowers_"..name..".png"},
inventory_image = "moreflowers_"..name..".png",
wield_image = "moreflowers_"..name..".png",
sunlight_propagates = true,
paramtype = "light",
walkable = false,
buildable_to = true,
stack_max = 99,
visual_scale = 1.3,
wield_scale = {x=1, y=1.5, z=1},
groups = f_groups,
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = box
}
})
end
moreflowers.datas_simple = {
{
"wild_carrot",
"Wild Carrot",
@ -38,11 +67,23 @@ moreflowers.datas = {
{flammable = 1}
},
}
moreflowers.datas_tall = {
{
"teosinte",
"Teosinte",
{-0.5, -0.5, -0.5, 0.5, 1.2, 0.5},
{flammable = 1}
},
}
for _,item in pairs(moreflowers.datas) do
for _,item in pairs(moreflowers.datas_simple) do
add_simple_flower(unpack(item))
end
for _,item in pairs(moreflowers.datas_tall) do
add_tall_flower(unpack(item))
end
-- Plant spread TODO ?
-- Bunch of flowers
@ -102,7 +143,8 @@ if minetest.get_modpath("bonemeal") and bonemeal then
}
local flowers = {
"flowers:dandelion_white", "flowers:dandelion_yellow", "flowers:geranium",
"flowers:rose", "flowers:tulip", "flowers:viola", "moreflowers:wild_carrot"
"flowers:rose", "flowers:tulip", "flowers:viola", "moreflowers:wild_carrot",
"moreflowers:teosinte",
}
local dirt_with_grass_deco = {

View File

@ -18,7 +18,7 @@ local function register_mgv6_flower(name)
})
end
local function register_flower(seed, name)
--[[local function register_flower(seed, name, biomes_list)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
@ -37,13 +37,43 @@ local function register_flower(seed, name)
decoration = "moreflowers:" .. name,
})
end
--]]
function moreflowers.register_mgv6_decorations()
register_mgv6_flower("wild_carrot")
end
function moreflowers.register_decorations()
register_flower(368, "wild_carrot")
-- register_flower(368, "wild_carrot")
minetest.register_decoration(
{
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.025,
spread = {x = 200, y = 200, z = 200},
seed = 368,
octaves = 3,
persist = 0.6
},
biomes = {"grassland", "deciduous_forest", "coniferous_forest"},
y_min = 1,
y_max = 31000,
decoration = "moreflowers:wild_carrot",
})
minetest.register_decoration(
{
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
fill_ratio = 0.001,
biomes = {"rainforest"},
decoration = "moreflowers:teosinte",
height = 1,
})
end
-- detect mapgen

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B