Use buildable_to to find nodes that cannot be placed to

If the node cannot be placed to, it will be dug before replacing
and the player will get the item.
This commit is contained in:
coil 2019-06-24 18:35:07 -04:00
parent 7bfcb73607
commit 8df30a1166
1 changed files with 2 additions and 8 deletions

View File

@ -221,14 +221,8 @@ replacer.replace = function( itemstack, user, pointed_thing, mode )
-- give the player the item by simulating digging if possible
if( node.name ~= "air"
and node.name ~= "ignore"
and node.name ~= "default:lava_source"
and node.name ~= "default:lava_flowing"
and node.name ~= "default:river_water_source"
and node.name ~= "default:river_water_flowing"
and node.name ~= "default:water_source"
and node.name ~= "default:water_flowing" ) then
local node_def = minetest.registered_nodes[node.name]
if node_def and not node_def.buildable_to then
minetest.node_dig( pos, node, user );