changed water checks, jackolantern protection added

Bu işleme şunda yer alıyor:
TenPlus1 2019-05-08 19:30:20 +01:00
ebeveyn 4ad40a0ecb
işleme 7c22eea12c
4 değiştirilmiş dosya ile 15 ekleme ve 3 silme

Dosyayı Görüntüle

@ -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.

Dosyayı Görüntüle

@ -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,

Dosyayı Görüntüle

@ -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

Dosyayı Görüntüle

@ -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,
})
})