mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
Allow buttons to replace pointed node again
This commit is contained in:
parent
1357bd5555
commit
434c7a399a
1 changed files with 9 additions and 0 deletions
|
@ -62,6 +62,15 @@ local on_button_place = function(itemstack, placer, pointed_thing)
|
|||
end
|
||||
end
|
||||
|
||||
-- If the pointed node is buildable, let's look at the node *behind* that node
|
||||
if def.buildable_to then
|
||||
local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
|
||||
local actual = vector.subtract(under, dir)
|
||||
local actualnode = minetest.get_node(actual)
|
||||
def = minetest.registered_nodes[actualnode.name]
|
||||
groups = def.groups
|
||||
end
|
||||
|
||||
-- Only allow placement on full-cube solid opaque nodes
|
||||
if (not groups) or (not groups.solid) or (not groups.opaque) or (def.node_box and def.node_box.type ~= "regular") then
|
||||
return itemstack
|
||||
|
|
Loading…
Reference in a new issue