mirror of
https://codeberg.org/tenplus1/farming.git
synced 2024-12-27 19:20:20 +01:00
add pointed_thing to on_rightclick vars
This commit is contained in:
parent
b84374bfa5
commit
4227d967e5
@ -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
|
||||||
|
@ -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
|
||||||
|
4
init.lua
4
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",
|
||||||
@ -425,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