check for buildable-to when placing not just air
This commit is contained in:
parent
c295395ae8
commit
4ea4a808f0
@ -81,7 +81,8 @@ minetest.register_node("travelnet:travelnet", {
|
|||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
|
||||||
local pos = pointed_thing.above;
|
local pos = pointed_thing.above;
|
||||||
if( minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" ) then
|
local node_name = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name
|
||||||
|
if( not node_name or not minetest.registered_nodes[node_name].buildable_to ) then
|
||||||
|
|
||||||
minetest.chat_send_player( placer:get_player_name(), S('Not enough vertical space to place the travelnet box!'))
|
minetest.chat_send_player( placer:get_player_name(), S('Not enough vertical space to place the travelnet box!'))
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user