From ea9e0c62c9b3c02a3cf31696c567abc879012798 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Wed, 22 May 2019 21:20:46 -0400 Subject: update biome_lib, coloredwood, extra_stairsplus, farming redo, moreblocks, moretrees, plantlife, and ropes --- farming/README.md | 1 + farming/crops/pumpkin.lua | 4 ++++ farming/init.lua | 6 +++--- farming/license.txt | 3 +++ farming/soil.lua | 11 +++++++++-- 5 files changed, 20 insertions(+), 5 deletions(-) (limited to 'farming') diff --git a/farming/README.md b/farming/README.md index e0a3333..6f57096 100644 --- a/farming/README.md +++ b/farming/README.md @@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t ### Changelog: +- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection. - 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. diff --git a/farming/crops/pumpkin.lua b/farming/crops/pumpkin.lua index c362449..3960a26 100644 --- a/farming/crops/pumpkin.lua +++ b/farming/crops/pumpkin.lua @@ -46,6 +46,8 @@ minetest.register_node("farming:jackolantern", { groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), on_punch = function(pos, node, puncher) + local name = puncher:get_player_name() or "" + if minetest.is_protected(pos, name) then return end node.name = "farming:jackolantern_on" minetest.swap_node(pos, node) end, @@ -69,6 +71,8 @@ minetest.register_node("farming:jackolantern_on", { sounds = default.node_sound_wood_defaults(), drop = "farming:jackolantern", on_punch = function(pos, node, puncher) + local name = puncher:get_player_name() or "" + if minetest.is_protected(pos, name) then return end node.name = "farming:jackolantern" minetest.swap_node(pos, node) end, diff --git a/farming/init.lua b/farming/init.lua index aa7301e..a19c2df 100644 --- a/farming/init.lua +++ b/farming/init.lua @@ -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) @@ -497,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 diff --git a/farming/license.txt b/farming/license.txt index eba35f8..8584871 100644 --- a/farming/license.txt +++ b/farming/license.txt @@ -139,3 +139,6 @@ Created by PilzAdam and edited by SpaghettiToastBook (CC0): Created by VanessaE and edited by SpaghettiToastBook (CC0): farming_flour_multigrain.png + +Created by mDiyo (Natura), modified by TenPlus1 (License: CC BY-SA 3.0): + farming_barley.png diff --git a/farming/soil.lua b/farming/soil.lua index 0b4844a..d379f5d 100644 --- a/farming/soil.lua +++ b/farming/soil.lua @@ -52,7 +52,14 @@ minetest.register_abm({ end -- check if there is water nearby and change soil accordingly - if minetest.find_node_near(pos, 3, {"group:water"}) then +-- if minetest.find_node_near(pos, 3, {"group:water"}) then + + -- check if water is within 3 nodes horizontally and 1 below + if #minetest.find_nodes_in_area( + {x = pos.x + 3, y = pos.y - 1, z = pos.z + 3}, + {x = pos.x - 3, y = pos.y , z = pos.z - 3}, + {"group:water"}) > 0 then + if node.name == "farming:soil" then minetest.set_node(pos, {name = "farming:soil_wet"}) end @@ -64,4 +71,4 @@ minetest.register_abm({ minetest.set_node(pos, {name = "default:dirt"}) end end, -}) \ No newline at end of file +}) -- cgit v1.2.3