鏡像自
https://codeberg.org/tenplus1/farming.git
已同步 2025-09-15 20:05:20 +02:00
added cocoa beans on_rightclick check for custom nodes
此提交包含在:
11
cocoa.lua
11
cocoa.lua
@@ -10,14 +10,21 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname)
|
||||
if not pt or pt.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local under = minetest.get_node(pt.under)
|
||||
|
||||
|
||||
-- return if any of the nodes are not registered
|
||||
if not minetest.registered_nodes[under.name] then
|
||||
return
|
||||
end
|
||||
|
||||
-- am I right-clicking on something that has a custom on_place set?
|
||||
-- thanks to Krock for helping with this issue :)
|
||||
local def = minetest.registered_nodes[under.name]
|
||||
if def and def.on_rightclick then
|
||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||
end
|
||||
|
||||
-- check if pointing at jungletree
|
||||
if under.name ~= "default:jungletree"
|
||||
or minetest.get_node(pt.above).name ~= "air" then
|
||||
|
新增問題並參考
封鎖使用者