From 3b3309ea43fee8a171c4c5bfa7ffaf38ee421144 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sun, 14 May 2023 12:52:47 +0000 Subject: [PATCH] Respect all slots upon digging and disallow TNT blasts (#11) This pull stops players digging a workbench containing items in any inventory, it also stops them being removed with tnt. --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 2114419..458f2f7 100644 --- a/init.lua +++ b/init.lua @@ -56,8 +56,9 @@ minetest.register_node("crafting_bench:workbench",{ can_dig = function(pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() - return inv:is_empty("main") + return inv:is_empty("src") and inv:is_empty("rec") and inv:is_empty("dst") end, + on_blast = function(pos) end, on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", player:get_player_name().." moves stuff in workbench at "..minetest.pos_to_string(pos)) end,