From cb1999414bcf7bf55f9ea52e897409f61ccdd0f4 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 23 Sep 2024 06:58:19 +0200 Subject: [PATCH 1/2] Fix putting items in protected smithing tables --- mods/ITEMS/mcl_smithing_table/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ITEMS/mcl_smithing_table/init.lua b/mods/ITEMS/mcl_smithing_table/init.lua index 1294c2c52..5e0b129b0 100755 --- a/mods/ITEMS/mcl_smithing_table/init.lua +++ b/mods/ITEMS/mcl_smithing_table/init.lua @@ -167,6 +167,12 @@ minetest.register_node("mcl_smithing_table:table", { end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end + local stackname = stack:get_name() local def = stack:get_definition() if From 78125f425a78470f4fc12e9942294736a9d5bf87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikita=20Wi=C5=9Bniewski?= Date: Sat, 28 Sep 2024 10:32:17 +0700 Subject: [PATCH 2/2] Fix taking items out of protected smithing tables --- mods/ITEMS/mcl_smithing_table/init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mods/ITEMS/mcl_smithing_table/init.lua b/mods/ITEMS/mcl_smithing_table/init.lua index 5e0b129b0..29d59b152 100755 --- a/mods/ITEMS/mcl_smithing_table/init.lua +++ b/mods/ITEMS/mcl_smithing_table/init.lua @@ -193,6 +193,16 @@ minetest.register_node("mcl_smithing_table:table", { return 0 end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + else + return stack:get_count() + end + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) return 0 end,