1
0
Fork 0

sl4v & Nicu: Don't open chests if there is a full block above them, for 1-node normal & trapped chests

This commit is contained in:
kay27 2020-09-30 00:32:28 +04:00
parent a511152cdf
commit 3cd30a559e
1 changed files with 4 additions and 0 deletions

View File

@ -227,6 +227,10 @@ minetest.register_node("mcl_chests:"..basename, {
_mcl_hardness = 2.5, _mcl_hardness = 2.5,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
if minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name].groups.opaque == 1 then
-- won't open if there is no space from the top
return false
end
local name = minetest.get_meta(pos):get_string("name") local name = minetest.get_meta(pos):get_string("name")
if name == "" then if name == "" then
name = S("Chest") name = S("Chest")