From d9c42344abeb7f0ab48580133b2ac1156a59b346 Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Sat, 27 Nov 2021 20:32:13 -0500 Subject: [PATCH] fix removing item with inv contents https://github.com/mt-mods/homedecor_modpack/issues/3 --- homedecor_bathroom/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/homedecor_bathroom/init.lua b/homedecor_bathroom/init.lua index 20e18ae2..c344bbdb 100644 --- a/homedecor_bathroom/init.lua +++ b/homedecor_bathroom/init.lua @@ -91,6 +91,10 @@ homedecor.register("medicine_cabinet", { node.name = "homedecor:medicine_cabinet_open" minetest.swap_node(pos, node) end, + can_dig = function(pos) + local inv = minetest.get_meta(pos):get_inventory("main") + return inv:is_empty("main") + end, infotext=S("Medicine cabinet"), inventory = { size=6, @@ -115,6 +119,10 @@ homedecor.register("medicine_cabinet_open", { node.name = "homedecor:medicine_cabinet" minetest.swap_node(pos, node) end, + can_dig = function(pos) + local inv = minetest.get_meta(pos):get_inventory("main") + return inv:is_empty("main") + end, }) -- "Sanitation" related