defining temperature and humidity range for crops

master
ademant 2018-10-08 18:35:03 +02:00
parent db6c0693cc
commit 3f79919faf
21 changed files with 96 additions and 72 deletions

View File

@ -17,7 +17,7 @@ farming.register_plant("farming:barley", {
max_humidity=70,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_max = 500,
spawnby = nil,
spawn_num = -1},
eat_hp=1,

View File

@ -13,7 +13,7 @@ local po_def={
place_param2 = 3,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 10,
spawn_max = 100,
spawn_max = 250,
spawnby = nil,
scale = 0.006, -- 0.006
spawn_num = -1},
@ -29,9 +29,9 @@ local po_def={
intervall = 12,
change = 0.0001, --part of soil, which get plants
},
min_temp=10,
min_temp=20,
max_temp=50,
min_humidity=10,
min_humidity=30,
max_humidity=70,
}
farming.register_plant("farming:beetroot", po_def)

View File

@ -13,13 +13,13 @@ local sdef={
fertility = {"grassland"},
groups = {food=1,grain = 1, flammable = 4,no_harvest=1 ,punchable = 1,snappy=1},
place_param2 = 3,
min_temp=15,
min_temp=25,
max_temp=55,
min_humidity=10,
min_humidity=30,
max_humidity=70,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_max = 200,
spawnby = nil,
spawn_num = -1},
description = S("Blackberry"),

View File

@ -11,12 +11,22 @@ farming.register_plant("farming:blueberry", {
fertility = {"grassland"},
groups = {food_wheat = 1, flammable = 4,no_seed=1},
place_param2 = 3,
min_temp=20,
max_temp=55,
min_humidity=50,
max_humidity=70,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_min = 10,
spawn_max = 100,
spawnby = nil,
scale = 0.006, -- 0.006
spawn_num = -1}
spawn_num = -1},
spread = {spreadon = farming.change_soil or {"default:dirt_with_grass"},
base_rate = 1,
spread = 50,
intervall = 12,
change = 0.00001, --part of soil, which get plants
},
})

View File

@ -13,7 +13,7 @@ local po_def={
place_param2 = 3,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 10,
spawn_max = 100,
spawn_max = 150,
spawnby = nil,
scale = 0.006, -- 0.006
spawn_num = -1},
@ -30,9 +30,9 @@ local po_def={
change = 0.0001, --part of soil, which get plants
},
min_temp=10,
max_temp=50,
min_humidity=10,
max_humidity=70,
max_temp=40,
min_humidity=20,
max_humidity=50,
}
farming.register_plant("farming:carrot", po_def)

View File

@ -12,11 +12,21 @@ farming.register_plant("farming:chili", {
groups = {food_wheat = 1, flammable = 4},
place_param2 = 3,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_min = 40,
spawn_max = 400,
spawnby = nil,
scale = 0.006, -- 0.006
spawn_num = -1}
spawn_num = -1},
spread = {spreadon = farming.change_soil or {"default:dirt_with_grass"},
base_rate = 10,
spread = 5,
intervall = 12,
change = 0.0001, --part of soil, which get plants
},
min_temp=40,
max_temp=70,
min_humidity=15,
max_humidity=50,
})

View File

@ -13,13 +13,13 @@ local sdef={
fertility = {"grassland"},
groups = {food=1,grain = 1, flammable = 4,no_harvest=1 ,punchable = 1,snappy=1},
place_param2 = 3,
min_temp=30,
min_temp=40,
max_temp=80,
min_humidity=40,
min_humidity=45,
max_humidity=100,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 100,
spawn_max = 200,
spawn_max = 2000,
spawnby = nil,
spawn_num = -1},
description = S("Cocoa"),

View File

@ -14,11 +14,11 @@ local sdef={
place_param2 = 3,
min_temp=30,
max_temp=80,
min_humidity=40,
min_humidity=50,
max_humidity=100,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 100,
spawn_max = 200,
spawn_min = 150,
spawn_max = 2000,
spawnby = nil,
spawn_num = -1},
description = S("Coffee"),

View File

@ -14,7 +14,7 @@ local po_def={
place_param2 = 3,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 10,
spawn_max = 100,
spawn_max = 150,
spawnby = nil,
scale = 0.006, -- 0.006
spawn_num = -1},
@ -24,9 +24,9 @@ local po_def={
intervall = 12,
change = 0.0001, --part of soil, which get plants
},
min_temp=20,
min_temp=30,
max_temp=60,
min_humidity=10,
min_humidity=40,
max_humidity=70,
}
farming.register_plant("farming:corn", po_def)

View File

@ -11,13 +11,13 @@ local cdef={
fertility = {"grassland"},
groups = {cotton = 1, flammable = 4,no_harvest=1,punchable=1},
place_param2 = 3,
min_temp=25,
max_temp=50,
min_humidity=30,
min_temp=45,
max_temp=80,
min_humidity=40,
max_humidity=70,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_min = 50,
spawn_max = 500,
spawnby = nil,
spawn_num = -1},
description = S("Cotton Seed"),

View File

@ -13,10 +13,14 @@ farming.register_plant("farming:garlic", {
place_param2 = 3,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_max = 500,
spawnby = nil,
scale = 0.006, -- 0.006
spawn_num = -1}
spawn_num = -1},
min_temp=25,
max_temp=50,
min_humidity=30,
max_humidity=70,
})

View File

@ -11,13 +11,13 @@ farming.register_plant("farming:hops", {
fertility = {"grassland"},
groups = {food_wheat=1, grain = 1, flammable = 4, on_soil = 1,snappy=1,food=1,punchable=1},
place_param2 = 3,
min_temp=20,
max_temp=50,
min_humidity=20,
max_humidity=70,
min_temp=25,
max_temp=55,
min_humidity=50,
max_humidity=80,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_max = 100,
spawnby = nil,
spawn_num = -1},
eat_hp=1,

View File

@ -11,13 +11,13 @@ farming.register_plant("farming:mustard", {
fertility = {"grassland"},
groups = {food_mustard=1, grain = 1, flammable = 4, snappy=1,food=1,no_harvest=1},
place_param2 = 3,
min_temp=10,
max_temp=50,
min_temp=40,
max_temp=70,
min_humidity=10,
max_humidity=70,
max_humidity=40,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_min = 20,
spawn_max = 150,
spawnby = nil,
spawn_num = -1},
spread = {spreadon = farming.change_soil or {"default:dirt_with_grass"},

View File

@ -13,8 +13,8 @@ local po_def={
groups = {food_wheat = 1, flammable = 4,no_harvest=1, on_soil = 1,snappy=1,food=1,infectable=1},
place_param2 = 3,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 10,
spawn_max = 100,
spawn_min = 50,
spawn_max = 300,
spawnby = nil,
scale = 0.006, -- 0.006
spawn_num = -1},
@ -30,9 +30,9 @@ local po_def={
intervall = 12,
change = 0.0001, --part of soil, which get plants
},
min_temp=10,
max_temp=50,
min_humidity=10,
min_temp=25,
max_temp=60,
min_humidity=30,
max_humidity=70,
}
farming.register_plant("farming:potato", po_def)

View File

@ -13,13 +13,13 @@ local sdef={
fertility = {"grassland"},
groups = {food=1,grain = 1, flammable = 4,no_harvest=1 ,punchable = 1,snappy=1},
place_param2 = 3,
min_temp=10,
min_temp=20,
max_temp=50,
min_humidity=10,
min_humidity=30,
max_humidity=70,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_max = 500,
spawnby = nil,
spawn_num = -1},
description = S("Raspberry"),

View File

@ -11,9 +11,13 @@ farming.register_plant("farming:rhubarb", {
fertility = {"grassland"},
groups = {food_wheat = 1, flammable = 4,no_seed=1},
place_param2 = 3,
min_temp=20,
max_temp=40,
min_humidity=30,
max_humidity=50,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_max = 50,
spawnby = nil,
scale = 0.006, -- 0.006
spawn_num = -1}

View File

@ -11,10 +11,10 @@ farming.register_plant("farming:spelt", {
fertility = {"grassland"},
groups = {food_wheat=1, grain = 1, flammable = 4, on_soil = 1,snappy=1,food=1},
place_param2 = 3,
min_temp=00,
min_temp=10,
max_temp=60,
min_humidity=10,
max_humidity=50,
max_humidity=45,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 100,

View File

@ -14,12 +14,12 @@ local sdef={
groups = {food=1,grain = 1, flammable = 4,no_harvest=1 ,punchable = 1,snappy=1},
place_param2 = 3,
min_temp=10,
max_temp=50,
min_humidity=10,
max_temp=45,
min_humidity=20,
max_humidity=70,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_max = 500,
spawnby = nil,
spawn_num = -1},
description = S("Strawberry"),

View File

@ -11,13 +11,13 @@ farming.register_plant("farming:tomato", {
fertility = {"grassland"},
groups = {food_wheat=1, grain = 1, flammable = 4, on_soil = 1,snappy=1,food=1,punchable=1},
place_param2 = 3,
min_temp=10,
max_temp=50,
min_humidity=10,
min_temp=30,
max_temp=60,
min_humidity=30,
max_humidity=70,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_min = 25,
spawn_max = 100,
spawnby = nil,
spawn_num = -1},
eat_hp=1,

View File

@ -13,13 +13,13 @@ local w1def={
fertility = {"grassland"},
groups = {food_wheat=1, grain = 1, flammable = 4, on_soil = 1,snappy=1,food=1,infectable=1},
place_param2 = 3,
min_temp=10,
min_temp=15,
max_temp=50,
min_humidity=10,
min_humidity=20,
max_humidity=70,
spawnon = { spawnon = farming.change_soil or {"default:dirt_with_grass"},
spawn_min = 0,
spawn_max = 42,
spawn_max = 50,
spawnby = nil,
spawn_num = -1},
description = S("Wheat Seed"),
@ -40,10 +40,6 @@ local w1def={
change = 0.0001, --part of soil, which get plants
},
}
--print(dump(w1def))
--if(table.getn(farming.possible_biomes)>0) then
-- def.biomes=farming.possible_biomes
--end
farming.register_plant("farming:wheat", w1def)
local wdef={

View File

@ -53,8 +53,8 @@ minetest.register_lbm({
minetest.register_abm({
nodenames = farming.change_soil,
neighbors = {"air"},
interval = 5+math.random(-1,1), -- little noise
chance = 1,
interval = 15+math.random(-1,1), -- little noise
chance = 2,
action = function(pos)
local ptabove={x=pos.x,y=pos.y+1,z=pos.z}
local above = minetest.get_node(ptabove)
@ -71,7 +71,7 @@ minetest.register_abm({
if #minetest.find_nodes_in_area(pos0,pos1,"group:farming") > 2 then
return
end
if math.random(0,10) < 1 then
if math.random(0,100) < 1 then
local node_temp=minetest.get_heat(pos)
local node_hum=minetest.get_humidity(pos)
local sc={}