forked from nalc/homedecor_modpack
		
	Add inventory images for medicine cabinet and toilet paper
add craft recipe for medicine cabinet, move it to misc-bathroom.lua
This commit is contained in:
		@@ -1967,6 +1967,15 @@ minetest.register_craft({
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_craft({
 | 
				
			||||||
 | 
					    output = "homedecor:medicine_cabinet",
 | 
				
			||||||
 | 
					    recipe = {
 | 
				
			||||||
 | 
							{ "group:stick", "default:glass", "group:stick" },
 | 
				
			||||||
 | 
							{ "group:stick", "default:glass", "group:stick" },
 | 
				
			||||||
 | 
							{ "group:stick", "default:glass", "group:stick" }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_craft({
 | 
					minetest.register_craft({
 | 
				
			||||||
    output = "homedecor:cardboard_box 2",
 | 
					    output = "homedecor:cardboard_box 2",
 | 
				
			||||||
    recipe = {
 | 
					    recipe = {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -62,6 +62,67 @@ minetest.register_node("homedecor:towel_rod", {
 | 
				
			|||||||
	sounds = default.node_sound_defaults(),
 | 
						sounds = default.node_sound_defaults(),
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					minetest.register_node('homedecor:medicine_cabinet', {
 | 
				
			||||||
 | 
						drawtype = "nodebox",
 | 
				
			||||||
 | 
						description = S("Medicine Cabinet"),
 | 
				
			||||||
 | 
						tiles = {
 | 
				
			||||||
 | 
							'homedecor_medicine_cabinet_tb.png',
 | 
				
			||||||
 | 
							'homedecor_medicine_cabinet_tb.png',
 | 
				
			||||||
 | 
							'homedecor_medicine_cabinet_sides.png',
 | 
				
			||||||
 | 
							'homedecor_medicine_cabinet_sides.png',
 | 
				
			||||||
 | 
							'homedecor_medicine_cabinet_back.png',
 | 
				
			||||||
 | 
							'homedecor_medicine_cabinet_front.png'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						inventory_image = "homedecor_medicine_cabinet_inv.png",
 | 
				
			||||||
 | 
						sunlight_propagates = false,
 | 
				
			||||||
 | 
						paramtype = "light",
 | 
				
			||||||
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 | 
						walkable = true,
 | 
				
			||||||
 | 
					    selection_box = {
 | 
				
			||||||
 | 
					        type = "fixed",
 | 
				
			||||||
 | 
							fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    node_box = {
 | 
				
			||||||
 | 
							type = "fixed",
 | 
				
			||||||
 | 
							fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						groups = { snappy = 3 },
 | 
				
			||||||
 | 
						sounds = default.node_sound_wood_defaults(),
 | 
				
			||||||
 | 
						on_construct = function(pos)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos)
 | 
				
			||||||
 | 
							meta:set_string("formspec",
 | 
				
			||||||
 | 
									"size[8,7]"..
 | 
				
			||||||
 | 
									"list[current_name;main;1,0;6,1;]"..
 | 
				
			||||||
 | 
									"list[current_player;main;0,3;8,4;]")
 | 
				
			||||||
 | 
							meta:set_string("infotext", S("Medicine cabinet"))
 | 
				
			||||||
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
 | 
							inv:set_size("main", 16)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						can_dig = function(pos,player)
 | 
				
			||||||
 | 
							local meta = minetest.get_meta(pos);
 | 
				
			||||||
 | 
							local inv = meta:get_inventory()
 | 
				
			||||||
 | 
							return inv:is_empty("main")
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
 | 
				
			||||||
 | 
							minetest.log("action", S("%s moves stuff in medicine cabinet at %s"):format(
 | 
				
			||||||
 | 
							    player:get_player_name(),
 | 
				
			||||||
 | 
							    minetest.pos_to_string(pos)
 | 
				
			||||||
 | 
							))
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					    on_metadata_inventory_put = function(pos, listname, index, stack, player)
 | 
				
			||||||
 | 
							minetest.log("action", S("%s moves stuff to medicine cabinet at %s"):format(
 | 
				
			||||||
 | 
							    player:get_player_name(),
 | 
				
			||||||
 | 
							    minetest.pos_to_string(pos)
 | 
				
			||||||
 | 
							))
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					    on_metadata_inventory_take = function(pos, listname, index, stack, player)
 | 
				
			||||||
 | 
							minetest.log("action", S("%s takes stuff from medicine cabinet at %s"):format(
 | 
				
			||||||
 | 
							    player:get_player_name(),
 | 
				
			||||||
 | 
							    minetest.pos_to_string(pos)
 | 
				
			||||||
 | 
							))
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_node("homedecor:toilet_paper", {
 | 
					minetest.register_node("homedecor:toilet_paper", {
 | 
				
			||||||
	description = S("Toilet paper"),
 | 
						description = S("Toilet paper"),
 | 
				
			||||||
	tiles = {
 | 
						tiles = {
 | 
				
			||||||
@@ -72,6 +133,7 @@ minetest.register_node("homedecor:toilet_paper", {
 | 
				
			|||||||
		"homedecor_toilet_paper_back.png",
 | 
							"homedecor_toilet_paper_back.png",
 | 
				
			||||||
		"homedecor_toilet_paper_front.png"
 | 
							"homedecor_toilet_paper_front.png"
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
						inventory_image = "homedecor_toilet_paper_inv.png",
 | 
				
			||||||
	drawtype = "nodebox",
 | 
						drawtype = "nodebox",
 | 
				
			||||||
	paramtype = "light",
 | 
						paramtype = "light",
 | 
				
			||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -633,64 +633,3 @@ minetest.register_node("homedecor:dishwasher_granite", {
 | 
				
			|||||||
	paramtype2 = "facedir",
 | 
						paramtype2 = "facedir",
 | 
				
			||||||
	groups = { snappy = 3 },
 | 
						groups = { snappy = 3 },
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_node('homedecor:medicine_cabinet', {
 | 
					 | 
				
			||||||
	drawtype = "nodebox",
 | 
					 | 
				
			||||||
	description = S("Medicine Cabinet"),
 | 
					 | 
				
			||||||
	tiles = {
 | 
					 | 
				
			||||||
		'homedecor_medicine_cabinet_tb.png',
 | 
					 | 
				
			||||||
		'homedecor_medicine_cabinet_tb.png',
 | 
					 | 
				
			||||||
		'homedecor_medicine_cabinet_sides.png',
 | 
					 | 
				
			||||||
		'homedecor_medicine_cabinet_sides.png',
 | 
					 | 
				
			||||||
		'homedecor_medicine_cabinet_back.png',
 | 
					 | 
				
			||||||
		'homedecor_medicine_cabinet_front.png'
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	sunlight_propagates = false,
 | 
					 | 
				
			||||||
	paramtype = "light",
 | 
					 | 
				
			||||||
	paramtype2 = "facedir",
 | 
					 | 
				
			||||||
	walkable = true,
 | 
					 | 
				
			||||||
    selection_box = {
 | 
					 | 
				
			||||||
        type = "fixed",
 | 
					 | 
				
			||||||
		fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    node_box = {
 | 
					 | 
				
			||||||
		type = "fixed",
 | 
					 | 
				
			||||||
		fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	groups = { snappy = 3 },
 | 
					 | 
				
			||||||
	sounds = default.node_sound_wood_defaults(),
 | 
					 | 
				
			||||||
	on_construct = function(pos)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos)
 | 
					 | 
				
			||||||
		meta:set_string("formspec",
 | 
					 | 
				
			||||||
				"size[8,7]"..
 | 
					 | 
				
			||||||
				"list[current_name;main;1,0;6,1;]"..
 | 
					 | 
				
			||||||
				"list[current_player;main;0,3;8,4;]")
 | 
					 | 
				
			||||||
		meta:set_string("infotext", S("Medicine cabinet"))
 | 
					 | 
				
			||||||
		local inv = meta:get_inventory()
 | 
					 | 
				
			||||||
		inv:set_size("main", 16)
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	can_dig = function(pos,player)
 | 
					 | 
				
			||||||
		local meta = minetest.get_meta(pos);
 | 
					 | 
				
			||||||
		local inv = meta:get_inventory()
 | 
					 | 
				
			||||||
		return inv:is_empty("main")
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
 | 
					 | 
				
			||||||
		minetest.log("action", S("%s moves stuff in medicine cabinet at %s"):format(
 | 
					 | 
				
			||||||
		    player:get_player_name(),
 | 
					 | 
				
			||||||
		    minetest.pos_to_string(pos)
 | 
					 | 
				
			||||||
		))
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
    on_metadata_inventory_put = function(pos, listname, index, stack, player)
 | 
					 | 
				
			||||||
		minetest.log("action", S("%s moves stuff to medicine cabinet at %s"):format(
 | 
					 | 
				
			||||||
		    player:get_player_name(),
 | 
					 | 
				
			||||||
		    minetest.pos_to_string(pos)
 | 
					 | 
				
			||||||
		))
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
    on_metadata_inventory_take = function(pos, listname, index, stack, player)
 | 
					 | 
				
			||||||
		minetest.log("action", S("%s takes stuff from medicine cabinet at %s"):format(
 | 
					 | 
				
			||||||
		    player:get_player_name(),
 | 
					 | 
				
			||||||
		    minetest.pos_to_string(pos)
 | 
					 | 
				
			||||||
		))
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								homedecor/textures/homedecor_medicine_cabinet_inv.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								homedecor/textures/homedecor_medicine_cabinet_inv.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 5.1 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								homedecor/textures/homedecor_toilet_paper_inv.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								homedecor/textures/homedecor_toilet_paper_inv.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 3.0 KiB  | 
		Reference in New Issue
	
	Block a user