mirror of
				https://github.com/mt-mods/homedecor_modpack.git
				synced 2025-11-04 09:25:36 +01:00 
			
		
		
		
	fix removing item with inv contents https://github.com/mt-mods/homedecor_modpack/issues/3
This commit is contained in:
		@@ -91,6 +91,10 @@ homedecor.register("medicine_cabinet", {
 | 
				
			|||||||
		node.name = "homedecor:medicine_cabinet_open"
 | 
							node.name = "homedecor:medicine_cabinet_open"
 | 
				
			||||||
		minetest.swap_node(pos, node)
 | 
							minetest.swap_node(pos, node)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
 | 
						can_dig = function(pos)
 | 
				
			||||||
 | 
							local inv = minetest.get_meta(pos):get_inventory("main")
 | 
				
			||||||
 | 
							return inv:is_empty("main")
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
	infotext=S("Medicine cabinet"),
 | 
						infotext=S("Medicine cabinet"),
 | 
				
			||||||
	inventory = {
 | 
						inventory = {
 | 
				
			||||||
		size=6,
 | 
							size=6,
 | 
				
			||||||
@@ -115,6 +119,10 @@ homedecor.register("medicine_cabinet_open", {
 | 
				
			|||||||
		node.name = "homedecor:medicine_cabinet"
 | 
							node.name = "homedecor:medicine_cabinet"
 | 
				
			||||||
		minetest.swap_node(pos, node)
 | 
							minetest.swap_node(pos, node)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
 | 
						can_dig = function(pos)
 | 
				
			||||||
 | 
							local inv = minetest.get_meta(pos):get_inventory("main")
 | 
				
			||||||
 | 
							return inv:is_empty("main")
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- "Sanitation" related
 | 
					-- "Sanitation" related
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user