diff options
-rw-r--r-- | init.lua | 1 | ||||
-rw-r--r-- | mapgen.lua | 51 |
2 files changed, 52 insertions, 0 deletions
@@ -469,5 +469,6 @@ minetest.register_abm({ -- cooking recipes that mix craftitems dofile(modpath .. "/cooking.lua") +dofile(modpath .. "/mapgen.lua") minetest.log("action", "[crops] loaded.") diff --git a/mapgen.lua b/mapgen.lua new file mode 100644 index 0000000..9744584 --- /dev/null +++ b/mapgen.lua @@ -0,0 +1,51 @@ + +local mg_params = minetest.get_mapgen_params() +if mg_params.mgname == "v6" then + -- not supported at this point +elseif mg_params.mgname ~= "singlenode" then + minetest.register_decoration({ + deco_type = "simple", + place_on = { "default:dirt_with_grass" }, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.02, + spread = {x = 200, y = 200, z = 200}, + seed = 90459126, + octaves = 3, + persist = 0.6 + }, + biomes = {"stone_grassland", "sandstone_grassland", + "deciduous_forest", "coniferous_forest"}, + y_min = 1, + y_max = 31000, + decoration = "crops:melon_plant_4" + }) + minetest.register_decoration({ + deco_type = "simple", + place_on = { "default:dirt_with_grass" }, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.02, + spread = {x = 200, y = 200, z = 200}, + seed = 26294592, + octaves = 3, + persist = 0.6 + }, + biomes = {"deciduous_forest", "coniferous_forest", "tundra"}, + y_min = 1, + y_max = 31000, + decoration = "crops:pumpkin_plant_4" + }) +end + +-- drop potatoes when digging in dirt +minetest.override_item("default:dirt_with_grass", { + drop = { + items = { + { items = {'default:dirt'}}, + { items = {'crops:potato'}, rarity = 500 } + } + } +}) |