1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2025-06-30 07:11:13 +02:00

Merge branch 'master' into nalc-1.2

This commit is contained in:
2019-05-09 21:40:50 +02:00
56 changed files with 509 additions and 80 deletions

View File

@ -7,7 +7,7 @@
farming = {
mod = "redo",
version = "20180929",
version = "20190427",
path = minetest.get_modpath("farming"),
select = {
type = "fixed",
@ -322,14 +322,14 @@ function farming.plant_growth_timer(pos, elapsed, node_name)
end
local growth
local light_pos = {x = pos.x, y = pos.y, z = pos.z} -- was y + 1
local light_pos = {x = pos.x, y = pos.y, z = pos.z}
local lambda = elapsed / STAGE_LENGTH_AVG
if lambda < 0.1 then
return true
end
local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 13
local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 12
local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or 15
--print ("---", MIN_LIGHT, MAX_LIGHT)
@ -457,6 +457,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
minetest.set_node(pt.above, {name = plantname, param2 = p2})
--minetest.get_node_timer(pt.above):start(1)
--farming.handle_growth(pt.above)--, node)
minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
@ -496,7 +497,7 @@ farming.register_plant = function(name, def)
-- Check def
def.description = def.description or S("Seed")
def.inventory_image = def.inventory_image or "unknown_item.png"
def.minlight = def.minlight or 13
def.minlight = def.minlight or 12
def.maxlight = def.maxlight or 15
-- Register seed
@ -591,37 +592,38 @@ farming.registered_plants[mname .. ":" .. pname] = {
minlight = def.minlight,
maxlight = def.maxlight
}
print(dump(farming.registered_plants[mname .. ":" .. pname]))
--print(dump(farming.registered_plants[mname .. ":" .. pname]))
-- Return info
return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname}
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.rarety = 0.002 -- 0.006
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
-- Load new global settings if found inside mod folder
@ -629,16 +631,14 @@ local input = io.open(farming.path.."/farming.conf", "r")
if input then
dofile(farming.path .. "/farming.conf")
input:close()
input = nil
end
-- load new world-specific settings if found inside world folder
local worldpath = minetest.get_worldpath()
local input = io.open(worldpath.."/farming.conf", "r")
input = io.open(worldpath.."/farming.conf", "r")
if input then
dofile(worldpath .. "/farming.conf")
input:close()
input = nil
end
@ -685,6 +685,7 @@ ddoo("pineapple.lua", farming.pineapple)
ddoo("peas.lua", farming.peas)
ddoo("beetroot.lua", farming.beetroot)
ddoo("chili.lua", farming.chili)
ddoo("ryeoatrice.lua", farming.grains)
dofile(farming.path.."/food.lua")
dofile(farming.path.."/mapgen.lua")