From 68e5c19df46215a2252a4d99fe75b13182f5cd77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikita=20Wi=C5=9Bniewski?= Date: Sun, 26 May 2024 15:21:14 +0000 Subject: [PATCH] Add new `supported_node_facedir` group and apply it to item frames (#4291) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change should fix item frames not placing on chests and similar blocks Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4291 Reviewed-by: the-real-herowl Co-authored-by: Mikita Wiśniewski Co-committed-by: Mikita Wiśniewski --- mods/CORE/mcl_attached/init.lua | 11 +++++++++++ mods/ITEMS/mcl_itemframes/item_frames_API.lua | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mods/CORE/mcl_attached/init.lua b/mods/CORE/mcl_attached/init.lua index c75bc49e0..51ea2b0ae 100644 --- a/mods/CORE/mcl_attached/init.lua +++ b/mods/CORE/mcl_attached/init.lua @@ -94,5 +94,16 @@ function minetest.check_single_for_falling(pos) end end + if get_item_group(node.name, "supported_node_facedir") ~= 0 then + local dir = facedir_to_dir(node.param2) + if dir then + local def = registered_nodes[get_node(vector.add(pos, dir)).name] + if def and def.drawtype == "airlike" then + drop_attached_node(pos) + return true + end + end + end + return false end diff --git a/mods/ITEMS/mcl_itemframes/item_frames_API.lua b/mods/ITEMS/mcl_itemframes/item_frames_API.lua index 3cc1aaccd..b1b59e423 100644 --- a/mods/ITEMS/mcl_itemframes/item_frames_API.lua +++ b/mods/ITEMS/mcl_itemframes/item_frames_API.lua @@ -638,7 +638,7 @@ function mcl_itemframes.create_base_definitions() paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, - groups = { dig_immediate = 3, deco_block = 1, dig_by_piston = 1, container = 1, attached_node_facedir = 1 }, + groups = { dig_immediate = 3, deco_block = 1, dig_by_piston = 1, container = 1, supported_node_facedir = 1 }, sounds = mcl_sounds.node_sound_defaults(), node_placement_prediction = "",