diff --git a/README.md b/README.md index e0a3333..30e5673 100644 --- a/README.md +++ b/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 2 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/crops/pumpkin.lua b/crops/pumpkin.lua index c362449..3960a26 100644 --- a/crops/pumpkin.lua +++ b/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/init.lua b/init.lua index aa7301e..6291ddc 100644 --- a/init.lua +++ b/init.lua @@ -322,7 +322,7 @@ 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 diff --git a/soil.lua b/soil.lua index 0b4844a..6e27d47 100644 --- a/soil.lua +++ b/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 2 below + if #minetest.find_nodes_in_area( + {x = pos.x + 3, y = pos.y + 2, 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 +})