Initial commit

This commit is contained in:
sys4-fr 2017-02-21 04:31:43 +01:00
parent 0d92dd394b
commit 872d7d96d4
7 changed files with 154 additions and 4 deletions

7
.gitignore vendored
View File

@ -1,5 +1,4 @@
# Compiled *.el
*.elc *~
*.autosave
# Packaging
.cask

3
depends.txt Normal file
View File

@ -0,0 +1,3 @@
flowers
farming?
vessels?

92
init.lua Normal file
View File

@ -0,0 +1,92 @@
moreflowers = {}
dofile(minetest.get_modpath("moreflowers").."/mapgen.lua")
-- flowers registration
local function add_simple_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,
groups = f_groups,
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = box
}
})
end
moreflowers.datas = {
{
"wild_carrot",
"Wild Carrot",
{-2 / 16, -0.5, -2 / 16, 2 / 16, 5 / 16, 2 / 16},
{flammable = 1}
},
}
for _,item in pairs(moreflowers.datas) do
add_simple_flower(unpack(item))
end
-- Plant spread TODO ?
-- Bunch of flowers
if minetest.get_modpath("farming") then
minetest.register_craftitem("moreflowers:bunch", {
description = "Bunch of flowers",
inventory_image = "moreflowers_bunch.png",
})
minetest.register_craft({
output = "moreflowers:bunch",
recipe = {
{"group:flower", "group:flower", "group:flower"},
{"group:flower", "group:flower", "group:flower"},
{"", "farming:cotton", ""},
},
})
if minetest.get_modpath("vessels") then
-- Bunch in a vase
minetest.register_node("moreflowers:bunch_vase", {
description = "Bunch in a vase",
drawtype = "plantlike",
tiles = {"moreflowers_bunch_vase.png"},
inventory_image = "moreflowers_bunch_vase.png",
wield_image = "moreflowers_bunch_vase.png",
paramtype = "light",
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
},
groups = {dig_immediate = 3, attached_node = 1, falling_node = 1},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_craft({
output = "moreflowers:bunch_vase",
type = "shapeless",
recipe = {"moreflowers:bunch", "group:vessel"},
})
end
end

56
mapgen.lua Normal file
View File

@ -0,0 +1,56 @@
-- decoration function
local function register_mgv6_flower(name)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.006,
spread = {x = 100, y = 100, z = 100},
seed = 368,
octaves = 3,
persist = 0.6
},
y_min = 1,
y_max = 30,
decoration = "moreflowers:"..name,
})
end
local function register_flower(seed, name)
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 = seed,
octaves = 3,
persist = 0.6
},
biomes = {"grassland", "deciduous_forest", "coniferous_forest"},
y_min = 1,
y_max = 31000,
decoration = "moreflowers:" .. name,
})
end
function moreflowers.register_mgv6_decorations()
register_mgv6_flower("wild_carrot")
end
function moreflowers.register_decorations()
register_flower(368, "wild_carrot")
end
-- detect mapgen
local mg_name = minetest.get_mapgen_setting("mg_name")
if mg_name == "v6" then
moreflowers.register_mgv6_decorations()
else
moreflowers.register_decorations()
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B