tweak leveled node placement.

they now stack regardless of face targetted, unless there's no space, or
player is sneaking.
This commit is contained in:
trans_soup 2023-10-22 22:37:00 +02:00
parent 512847f8f6
commit 1084214c10

View file

@ -58,10 +58,9 @@ local function on_place (itemstack, placer, pointed)
if not is_same_kind(pointed.under, placed_def.kindname) then return fallback_to_default() end
local above = pointed.under + vector.new(0, 1, 0)
local is_top = above == pointed.above
if not is_top then return fallback_to_default() end
if placer:is_player() and placer:get_player_control().sneak then return fallback_to_default() end
local above = pointed.under + vector.new(0, 1, 0)
local above_node = minetest.get_node(above)
local target_node = minetest.get_node(pointed.under)