mirror of
https://codeberg.org/tenplus1/farming.git
synced 2025-11-17 13:55:28 +01:00
Change weed chance, use min/max light globals when nil found.
This commit is contained in:
9
init.lua
9
init.lua
@@ -12,7 +12,7 @@ local S = core.get_translator("farming")
|
|||||||
|
|
||||||
farming = {
|
farming = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20250717",
|
version = "20251114",
|
||||||
path = core.get_modpath("farming"),
|
path = core.get_modpath("farming"),
|
||||||
select = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}},
|
select = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}},
|
||||||
select_final = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}},
|
select_final = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}},
|
||||||
@@ -262,7 +262,8 @@ local function set_growing(pos, stages_left)
|
|||||||
|
|
||||||
local stage_length = statistics.normal(STAGE_LENGTH_AVG, STAGE_LENGTH_DEV)
|
local stage_length = statistics.normal(STAGE_LENGTH_AVG, STAGE_LENGTH_DEV)
|
||||||
|
|
||||||
stage_length = clamp(stage_length, 0.5 * STAGE_LENGTH_AVG, 3.0 * STAGE_LENGTH_AVG)
|
stage_length = clamp(
|
||||||
|
stage_length, 0.5 * STAGE_LENGTH_AVG, 3.0 * STAGE_LENGTH_AVG)
|
||||||
|
|
||||||
timer:set(stage_length, -0.5 * random() * STAGE_LENGTH_AVG)
|
timer:set(stage_length, -0.5 * random() * STAGE_LENGTH_AVG)
|
||||||
end
|
end
|
||||||
@@ -502,8 +503,8 @@ function farming.register_plant(name, def)
|
|||||||
-- Check def
|
-- Check def
|
||||||
def.description = def.description or S("Seed")
|
def.description = def.description or S("Seed")
|
||||||
def.inventory_image = def.inventory_image or "unknown_item.png"
|
def.inventory_image = def.inventory_image or "unknown_item.png"
|
||||||
def.minlight = def.minlight or 12
|
def.minlight = def.minlight or farming.min_light
|
||||||
def.maxlight = def.maxlight or 15
|
def.maxlight = def.maxlight or farming.max_light
|
||||||
|
|
||||||
-- Register seed
|
-- Register seed
|
||||||
core.register_node(":" .. mname .. ":seed_" .. pname, {
|
core.register_node(":" .. mname .. ":seed_" .. pname, {
|
||||||
|
|||||||
2
soil.lua
2
soil.lua
@@ -203,7 +203,7 @@ if core.settings:get_bool("farming_disable_weeds") ~= true then
|
|||||||
nodenames = {"group:field"},
|
nodenames = {"group:field"},
|
||||||
neighbors = {"air"},
|
neighbors = {"air"},
|
||||||
interval = 50,
|
interval = 50,
|
||||||
chance = 45,
|
chance = 50,
|
||||||
catch_up = false,
|
catch_up = false,
|
||||||
|
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
|
|||||||
Reference in New Issue
Block a user