mirror of
				https://github.com/luanti-org/minetest_game.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Fire: Allow placing only above flammable blocks
This commit is contained in:
		
				
					committed by
					
						
						paramat
					
				
			
			
				
	
			
			
			
						parent
						
							7cba7af894
						
					
				
				
					commit
					7a29d26e3e
				
			@@ -78,15 +78,19 @@ minetest.register_tool("fire:flint_and_steel", {
 | 
			
		||||
		local pt = pointed_thing
 | 
			
		||||
 | 
			
		||||
		if pt.type == "node" and minetest.get_node(pt.above).name == "air" then
 | 
			
		||||
			if not minetest.is_protected(pt.above, player_name) then
 | 
			
		||||
				minetest.set_node(pt.above, {name="fire:basic_flame"})
 | 
			
		||||
			else
 | 
			
		||||
				minetest.chat_send_player(player_name, "This area is protected")
 | 
			
		||||
			itemstack:add_wear(1000)
 | 
			
		||||
			local node_under = minetest.get_node(pt.under).name
 | 
			
		||||
 | 
			
		||||
			if minetest.get_node_group(node_under, "flammable") >= 1 then
 | 
			
		||||
				if not minetest.is_protected(pt.above, player_name) then
 | 
			
		||||
					minetest.set_node(pt.above, {name = "fire:basic_flame"})
 | 
			
		||||
				else
 | 
			
		||||
					minetest.chat_send_player(player_name, "This area is protected")
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		if not minetest.setting_getbool("creative_mode") then
 | 
			
		||||
			itemstack:add_wear(1000)
 | 
			
		||||
			return itemstack
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user