add spawn rate for each crop in settings

This commit is contained in:
TenPlus1 2019-04-27 08:34:29 +01:00
parent 1c8dfd0cba
commit 561d0d01a1
4 changed files with 64 additions and 58 deletions

View File

@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t
### Changelog:
- 1.41 - Each crop has it's own spawn rate (can be changed in farming.conf)
- 1.40 - Added Mithril Scythe to quick harvest and replant crops on right-click. Added Hoe's for MoreOres with Toolrank support.
- 1.39 - Added Rice, Rye and Oats thanks to Ademants Grains mod. Added Jaffa Cake and multigrain bread.
- 1.38 - Pumpkin grows into block, use chopping board to cut into 4x slices, same with melon block, 2x2 slices makes a block, cocoa pods are no longer walkable

View File

@ -5,31 +5,32 @@
world folder for map specific settings.
--]]
-- true to enable crop/food in-game and on mapgen
farming.carrot = true
farming.potato = true
farming.tomato = true
farming.cucumber = true
farming.corn = true
farming.coffee = true
farming.melon = true
farming.pumpkin = true
farming.cocoa = true
farming.raspberry = true
farming.blueberry = true
farming.rhubarb = true
farming.beans = true
farming.grapes = true
farming.barley = true
farming.chili = true
farming.hemp = true
farming.onion = true
farming.garlic = true
farming.pepper = true
farming.pineapple = true
farming.peas = true
farming.beetroot = true
farming.grains = true
-- rarety of crops on map, default is 0.001 (higher number = more crops)
-- true to enable crop/food in-game and on mapgen set spawn rarety
farming.carrot = 0.001
farming.potato = 0.001
farming.tomato = 0.001
farming.cucumber = 0.001
farming.corn = 0.001
farming.coffee = 0.001
farming.melon = 0.001
farming.pumpkin = 0.001
farming.cocoa = true -- true or false only
farming.raspberry = 0.001
farming.blueberry = 0.001
farming.rhubarb = 0.001
farming.beans = 0.001
farming.grapes = 0.001
farming.barley = true -- true or false only
farming.chili = 0.002
farming.hemp = 0.002
farming.garlic = 0.001
farming.onion = 0.001
farming.pepper = 0.002
farming.pineapple = 0.001
farming.peas = 0.001
farming.beetroot = 0.001
farming.grains = true -- true or false only
farming.rarety = 0.002
-- rarety of crops on map, default is 0.002 (higher number = more crops)
farming.rarety = 0.002

View File

@ -7,7 +7,7 @@
farming = {
mod = "redo",
version = "20190111",
version = "20190427",
path = minetest.get_modpath("farming"),
select = {
type = "fixed",
@ -599,31 +599,31 @@ end
-- default settings
farming.carrot = true
farming.potato = true
farming.tomato = true
farming.cucumber = true
farming.corn = true
farming.coffee = true
farming.melon = true
farming.pumpkin = true
farming.carrot = 0.001
farming.potato = 0.001
farming.tomato = 0.001
farming.cucumber = 0.001
farming.corn = 0.001
farming.coffee = 0.001
farming.melon = 0.001
farming.pumpkin = 0.001
farming.cocoa = true
farming.raspberry = true
farming.blueberry = true
farming.rhubarb = true
farming.beans = true
farming.grapes = true
farming.raspberry = 0.001
farming.blueberry = 0.001
farming.rhubarb = 0.001
farming.beans = 0.001
farming.grapes = 0.001
farming.barley = true
farming.chili = true
farming.hemp = true
farming.garlic = true
farming.onion = true
farming.pepper = true
farming.pineapple = true
farming.peas = true
farming.beetroot = true
farming.chili = 0.002
farming.hemp = 0.002
farming.garlic = 0.001
farming.onion = 0.001
farming.pepper = 0.002
farming.pineapple = 0.001
farming.peas = 0.001
farming.beetroot = 0.001
farming.grains = true
farming.rarety = 0.002 -- 0.006
farming.rarety = 0.002
-- Load new global settings if found inside mod folder

View File

@ -1,18 +1,22 @@
-- decoration function
local function register_plant(name, min, max, spawnon, spawnby, num, enabled)
local function register_plant(name, min, max, spawnon, spawnby, num, rarety)
if enabled ~= true then
-- do not place on mapgen if no value given (or not true)
if not rarety then
return
end
-- set rarety value or default to farming.rarety if not a number
rarety = tonumber(rarety) or farming.rarety
minetest.register_decoration({
deco_type = "simple",
place_on = spawnon or {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = farming.rarety, -- 0.006,
scale = rarety,
spread = {x = 100, y = 100, z = 100},
seed = 329,
octaves = 3,
@ -55,7 +59,7 @@ else
register_plant("carrot_8", 1, 15, nil, "", -1, farming.carrot)
register_plant("cucumber_4", 1, 10, nil, "", -1, farming.cucumber)
register_plant("melon_8", 1, 6, {"default:dirt_with_dry_grass",
"default:dirt_with_rainforest_litter"}, "", -1, farming.melon)
"default:dirt_with_rainforest_litter"}, "", -1, farming.melon)
register_plant("pumpkin_8", 1, 6, nil, "", -1, farming.pumpkin)
end
@ -66,7 +70,7 @@ minetest.register_decoration({
sidelen = 16,
noise_params = {
offset = 0,
scale = farming.rarety, -- 0.06,
scale = tonumber(farming.hemp) or farming.rarety,
spread = {x = 100, y = 100, z = 100},
seed = 420,
octaves = 3,
@ -87,7 +91,7 @@ minetest.register_decoration({
sidelen = 16,
noise_params = {
offset = 0,
scale = farming.rarety, -- 0.06,
scale = tonumber(farming.chili) or farming.rarety,
spread = {x = 100, y = 100, z = 100},
seed = 760,
octaves = 3,
@ -108,7 +112,7 @@ minetest.register_decoration({
sidelen = 16,
noise_params = {
offset = 0,
scale = farming.rarety, -- 0.06,
scale = tonumber(farming.pepper) or farming.rarety,
spread = {x = 100, y = 100, z = 100},
seed = 933,
octaves = 3,
@ -129,7 +133,7 @@ minetest.register_decoration({
sidelen = 16,
noise_params = {
offset = 0,
scale = farming.rarety, -- 0.06,
scale = tonumber(farming.pineapple) or farming.rarety,
spread = {x = 100, y = 100, z = 100},
seed = 917,
octaves = 3,