mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-10-31 15:35:21 +01:00 
			
		
		
		
	Added minetest.wallmounted_to_dir
This commit is contained in:
		
				
					committed by
					
						 est31
						est31
					
				
			
			
				
	
			
			
			
						parent
						
							20405edb06
						
					
				
				
					commit
					b12bdcce34
				
			| @@ -139,6 +139,19 @@ function core.dir_to_wallmounted(dir) | |||||||
| 	end | 	end | ||||||
| end | end | ||||||
|  |  | ||||||
|  | function core.wallmounted_to_dir(wallmounted) | ||||||
|  | 	-- table of dirs in wallmounted order | ||||||
|  | 	return ({[0] = {x = 0, y = 1, z = 0}, | ||||||
|  | 		{x = 0,  y = -1, z = 0}, | ||||||
|  | 		{x = 1,  y = 0,  z = 0}, | ||||||
|  | 		{x = -1, y = 0,  z = 0}, | ||||||
|  | 		{x = 0,  y = 0,  z = 1}, | ||||||
|  | 		{x = 0,  y = 0,  z = -1}}) | ||||||
|  |  | ||||||
|  | 		--indexed into by the wallmounted in question | ||||||
|  | 		[wallmounted] | ||||||
|  | end | ||||||
|  |  | ||||||
| function core.get_node_drops(nodename, toolname) | function core.get_node_drops(nodename, toolname) | ||||||
| 	local drop = ItemStack({name=nodename}):get_definition().drop | 	local drop = ItemStack({name=nodename}):get_definition().drop | ||||||
| 	if drop == nil then | 	if drop == nil then | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user