forked from mtcontrib/homedecor_modpack
Applied cornernote's fix for the previous check-for-space attempt.
This commit is contained in:
parent
328633d60e
commit
701e5fdd52
@ -39,13 +39,13 @@ minetest.register_node('homedecor:refrigerator', {
|
|||||||
inv:set_size("main",50)
|
inv:set_size("main",50)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
after_place_node = function(pos, placer)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
ntop = minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z})
|
local pos = pointed_thing.above
|
||||||
if ntop.name ~= "air" then
|
if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
|
||||||
minetest.env:remove_node(pos)
|
minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a refrigerator!' )
|
||||||
placer:get_inventory():add_item("main", "homedecor:refrigerator")
|
return
|
||||||
minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a refrigerator!' )
|
|
||||||
end
|
end
|
||||||
|
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
|
Loading…
Reference in New Issue
Block a user