forked from mtcontrib/homedecor_modpack
		
	Added chainlink fence gate. Place a fence back into the crafting grid to get a
gate. Place it, then click it to open/close.
This commit is contained in:
		
							
								
								
									
										16
									
								
								crafts.lua
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								crafts.lua
									
									
									
									
									
								
							| @@ -1157,3 +1157,19 @@ minetest.register_craft( { | |||||||
|                 { "default:steel_ingot", "default:iron_lump", "default:steel_ingot" } |                 { "default:steel_ingot", "default:iron_lump", "default:steel_ingot" } | ||||||
|         }, |         }, | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | minetest.register_craft( { | ||||||
|  | 	type = "shapeless", | ||||||
|  |         output = "homedecor:fence_chainlink_gate_closed", | ||||||
|  |         recipe = { | ||||||
|  | 		"homedecor:fence_chainlink" | ||||||
|  |         }, | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | minetest.register_craft( { | ||||||
|  | 	type = "shapeless", | ||||||
|  |         output = "homedecor:fence_chainlink", | ||||||
|  |         recipe = { | ||||||
|  | 		"homedecor:fence_chainlink_gate_closed" | ||||||
|  |         }, | ||||||
|  | }) | ||||||
|   | |||||||
							
								
								
									
										93
									
								
								fences.lua
									
									
									
									
									
								
							
							
						
						
									
										93
									
								
								fences.lua
									
									
									
									
									
								
							| @@ -172,10 +172,95 @@ minetest.register_node("homedecor:fence_chainlink", { | |||||||
|         node_box = { |         node_box = { | ||||||
|                 type = "fixed", |                 type = "fixed", | ||||||
| 		fixed = { | 		fixed = { | ||||||
| 			{ -8/16, -8/16,  6/16, -7/16, 8/16,  8/16 },	-- left post | 			{ -8/16, -8/16,  6/16, -7/16,  8/16,  8/16 },	-- left post | ||||||
| 			{  7/16, -8/16,  6/16,  8/16, 8/16,  8/16 }, 	-- right post | 			{  7/16, -8/16,  6/16,  8/16,  8/16,  8/16 }, 	-- right post | ||||||
| 			{ -8/16,  7/16, 13/32,  8/16, 8/16, 15/32 },	-- top piece | 			{ -8/16,  7/16, 13/32,  8/16,  8/16, 15/32 },	-- top piece | ||||||
| 			{ -8/16, -8/16,  7/16,  8/16, 8/16,  7/16 }	-- the chainlink itself | 			{ -8/16, -8/16, 13/32,  8/16, -7/16, 15/32 },	-- bottom piece | ||||||
|  | 			{ -8/16, -8/16,  7/16,  8/16,  8/16,  7/16 }	-- the chainlink itself | ||||||
| 		}		 | 		}		 | ||||||
|         }, |         }, | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | minetest.register_node("homedecor:fence_chainlink_gate_closed", { | ||||||
|  | 	drawtype = "nodebox", | ||||||
|  |         description = "Chainlink Fence Gate", | ||||||
|  |         tiles = { | ||||||
|  | 		"homedecor_fence_chainlink_gate_tb.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_tb.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_sides.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_sides.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_backside.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_front.png", | ||||||
|  | 	}, | ||||||
|  |         paramtype = "light", | ||||||
|  |         is_ground_content = true, | ||||||
|  |         groups = {snappy=3}, | ||||||
|  |         sounds = default.node_sound_wood_defaults(), | ||||||
|  | 	walkable = true, | ||||||
|  | 	paramtype2 = "facedir", | ||||||
|  |         selection_box = { | ||||||
|  |                 type = "fixed", | ||||||
|  |                 fixed = { -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 } | ||||||
|  |         }, | ||||||
|  |         node_box = { | ||||||
|  |                 type = "fixed", | ||||||
|  | 		fixed = { | ||||||
|  | 			{ -8/16, -8/16,  6/16, -7/16,  8/16,  8/16 },	-- left post | ||||||
|  | 			{  6/16, -8/16,  6/16,  8/16,  8/16,  8/16 }, 	-- right post | ||||||
|  | 			{ -8/16,  7/16, 13/32,  8/16,  8/16, 15/32 },	-- top piece | ||||||
|  | 			{ -8/16, -8/16, 13/32,  8/16, -7/16, 15/32 },	-- bottom piece | ||||||
|  | 			{ -8/16, -8/16,  7/16,  8/16,  8/16,  7/16 },	-- the chainlink itself | ||||||
|  | 			{ -8/16, -3/16,  6/16, -6/16,  3/16,  8/16 }	-- the lump representing the lock | ||||||
|  | 		}		 | ||||||
|  |         }, | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | minetest.register_node("homedecor:fence_chainlink_gate_open", { | ||||||
|  | 	drawtype = "nodebox", | ||||||
|  |         description = "Chainlink Fence Gate (open)", | ||||||
|  |         tiles = { | ||||||
|  | 		"homedecor_fence_chainlink_gate_tb.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_tb.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_front.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_backside.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_sides.png", | ||||||
|  | 		"homedecor_fence_chainlink_gate_sides.png", | ||||||
|  | 	}, | ||||||
|  |         paramtype = "light", | ||||||
|  |         is_ground_content = true, | ||||||
|  |         groups = {snappy=3, not_in_creative_inventory=1}, | ||||||
|  |         sounds = default.node_sound_wood_defaults(), | ||||||
|  | 	walkable = true, | ||||||
|  | 	paramtype2 = "facedir", | ||||||
|  |         selection_box = { | ||||||
|  |                 type = "fixed", | ||||||
|  |                 fixed = { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5 } | ||||||
|  |         }, | ||||||
|  |         node_box = { | ||||||
|  |                 type = "fixed", | ||||||
|  | 		fixed = { | ||||||
|  | 			{  6/16, -8/16, -8/16,  8/16,  8/16, -7/16 },	-- left post | ||||||
|  | 			{  6/16, -8/16,  6/16,  8/16,  8/16,  8/16 }, 	-- right post | ||||||
|  | 			{ 13/32,  7/16, -8/16, 15/32,  8/16,  8/16 },	-- top piece | ||||||
|  | 			{ 13/32, -8/16, -8/16, 15/32, -7/16,  8/16 },	-- bottom piece | ||||||
|  | 			{  7/16, -8/16, -8/16,  7/16,  8/16,  8/16 },	-- the chainlink itself | ||||||
|  | 			{  6/16, -3/16, -8/16,  8/16,  3/16, -6/16 }	-- the lump representing the lock | ||||||
|  | 		}		 | ||||||
|  |         }, | ||||||
|  | 	drop = "homedecor:fence_chainlink_gate_closed" | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | minetest.register_on_punchnode(function (pos, node) | ||||||
|  | 	if node.name=="homedecor:fence_chainlink_gate_closed" then  | ||||||
|  | 		fdir=node.param2 | ||||||
|  | 		minetest.env:add_node(pos, { name = "homedecor:fence_chainlink_gate_open", param2 = fdir }) | ||||||
|  | 	end | ||||||
|  | end) | ||||||
|  |  | ||||||
|  | minetest.register_on_punchnode(function (pos, node) | ||||||
|  | 	if node.name=="homedecor:fence_chainlink_gate_open" then  | ||||||
|  | 		fdir=node.param2 | ||||||
|  | 		minetest.env:add_node(pos, { name = "homedecor:fence_chainlink_gate_closed", param2 = fdir }) | ||||||
|  | 	end | ||||||
|  | end) | ||||||
|  |  | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 475 B After Width: | Height: | Size: 500 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/homedecor_fence_chainlink_gate_backside.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								textures/homedecor_fence_chainlink_gate_backside.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 601 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/homedecor_fence_chainlink_gate_front.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								textures/homedecor_fence_chainlink_gate_front.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 591 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/homedecor_fence_chainlink_gate_sides.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								textures/homedecor_fence_chainlink_gate_sides.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 505 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/homedecor_fence_chainlink_gate_tb.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								textures/homedecor_fence_chainlink_gate_tb.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 490 B | 
		Reference in New Issue
	
	Block a user