forked from mtcontrib/farming
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
1b0e96cfc7
@ -27,7 +27,7 @@ local function place_beans(itemstack, placer, pointed_thing, plantname)
|
|||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if placer and itemstack and def and def.on_rightclick then
|
if placer and itemstack and def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- is player planting crop?
|
-- is player planting crop?
|
||||||
@ -120,7 +120,7 @@ minetest.register_node("farming:beanpole", {
|
|||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if def and def.on_rightclick then
|
if def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.is_protected(pt.above, placer:get_player_name()) then
|
if minetest.is_protected(pt.above, placer:get_player_name()) then
|
||||||
|
@ -22,7 +22,7 @@ local function place_cocoa(itemstack, placer, pointed_thing, plantname)
|
|||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if placer and itemstack and def and def.on_rightclick then
|
if placer and itemstack and def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- check if pointing at jungletree
|
-- check if pointing at jungletree
|
||||||
@ -146,10 +146,12 @@ local def = {
|
|||||||
},
|
},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
growth_check = function(pos, node_name)
|
growth_check = function(pos, node_name)
|
||||||
|
|
||||||
if minetest.find_node_near(pos, 1, {"default:jungletree"}) then
|
if minetest.find_node_near(pos, 1, {"default:jungletree"}) then
|
||||||
return false
|
return false -- can grow
|
||||||
end
|
end
|
||||||
return true
|
|
||||||
|
return true -- cannot grow
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ local function place_grapes(itemstack, placer, pointed_thing, plantname)
|
|||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if placer and itemstack and def and def.on_rightclick then
|
if placer and itemstack and def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- is player planting seed?
|
-- is player planting seed?
|
||||||
@ -115,7 +115,7 @@ minetest.register_node("farming:trellis", {
|
|||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if def and def.on_rightclick then
|
if def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.is_protected(pt.above, placer:get_player_name()) then
|
if minetest.is_protected(pt.above, placer:get_player_name()) then
|
||||||
|
@ -84,11 +84,6 @@ minetest.register_craftitem("farming:sunflower_bread", {
|
|||||||
groups = {food_bread = 1, flammable = 2}
|
groups = {food_bread = 1, flammable = 2}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("farming:sunflower_bread", {
|
|
||||||
description = S("Sunflower Bread"),
|
|
||||||
inventory_image = "farming_sunflower_bread.png"
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "farming:sunflower_bread",
|
output = "farming:sunflower_bread",
|
||||||
recipe = {{"group:food_sunflower_seeds_toasted", "group:food_bread", "group:food_sunflower_seeds_toasted"}}
|
recipe = {{"group:food_sunflower_seeds_toasted", "group:food_bread", "group:food_sunflower_seeds_toasted"}}
|
||||||
|
5
init.lua
5
init.lua
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
farming = {
|
farming = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210928",
|
version = "20211116",
|
||||||
path = minetest.get_modpath("farming"),
|
path = minetest.get_modpath("farming"),
|
||||||
select = {
|
select = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -340,7 +340,6 @@ function farming.plant_growth_timer(pos, elapsed, node_name)
|
|||||||
if max_growth == 1 or lambda < 2.0 then
|
if max_growth == 1 or lambda < 2.0 then
|
||||||
|
|
||||||
local light = (minetest.get_node_light(light_pos) or 0)
|
local light = (minetest.get_node_light(light_pos) or 0)
|
||||||
--print ("light level:", light)
|
|
||||||
|
|
||||||
if light < MIN_LIGHT or light > MAX_LIGHT then
|
if light < MIN_LIGHT or light > MAX_LIGHT then
|
||||||
return true
|
return true
|
||||||
@ -426,7 +425,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
|
|||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if placer and itemstack and def and def.on_rightclick then
|
if placer and itemstack and def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack, pt)
|
||||||
end
|
end
|
||||||
|
|
||||||
local above = minetest.get_node(pt.above)
|
local above = minetest.get_node(pt.above)
|
||||||
|
Loading…
Reference in New Issue
Block a user