atdalīts no nalc/nalc_game
Allow interaction with nodes while wielding these items.
- beds - boats - carts - key/skeleton key - seeds All these had on_place handlers that did not allow nodes with an on_rightclick() handler to be used first (if not using sneak). This code is taken from the torches mod and applied everywhere. This allows all these items to e.g. be inserted into the `frame` mod's item frames.
Šī revīzija ir iekļauta:
revīziju iesūtīja
Auke Kok
vecāks
d1b132555b
revīzija
78c632ebd4
@@ -313,6 +313,15 @@ farming.register_plant = function(name, def)
|
||||
}),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local under = pointed_thing.under
|
||||
local node = minetest.get_node(under)
|
||||
local udef = minetest.registered_nodes[node.name]
|
||||
if udef and udef.on_rightclick and
|
||||
not (placer and placer:get_player_control().sneak) then
|
||||
return udef.on_rightclick(under, node, placer, itemstack,
|
||||
pointed_thing) or itemstack
|
||||
end
|
||||
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":seed_" .. pname)
|
||||
end,
|
||||
next_plant = mname .. ":" .. pname .. "_1",
|
||||
|
||||
Atsaukties uz šo jaunā problēmā
Block a user