
if chemistry.node_particles == "All" then
	minetest.register_abm({
		label = "chemistry:liquid nitrogen vaporation",
		nodenames = {"group:freezer"},
		neighbors = {"air"},
		interval = 1.0,
		chance = 1,
		catch_up = true,
		action = function(pos, node)
			if minetest.find_node_near(pos, 1, "air") then

	      	minetest.add_particlespawner({
	      		amount = 2,
			      time = 1,
	      		minpos = {x = pos.x - 1, y = pos.y + 0.5, z = pos.z - 1},
		      	maxpos = {x = pos.x + 1, y = pos.y + 0.5, z = pos.z + 1},
			      minvel = {x = 0.2, y = 0.2, z = 0.2},
	      		maxvel = {x = 0.4, y = 0.8, z = 0.4},
		      	minacc = {x = -0.2, y = 0, z = -0.2},
	      		maxacc = {x = 0.2, y = 0.1, z = 0.2},
		      	minexptime = 2,
		      	maxexptime = 2,
	      		minsize = 1,
		      	maxsize = 3,
	      		collisiondetection = true,
	      		vertical = false,
	      		texture = "default_item_smoke.png"
	      	})
			end	
		end,
	})

minetest.register_abm({
	label = "chemistry:air pollution",
	nodenames = {"group:fire"},
	neighbors = {"group:flammable", "group:anthracite_material"},
	interval = 1.0,
	chance = 1,
	catch_up = true,
	action = function(pos, node)
		if minetest.find_node_near(pos, 1, "air") then

	   	minetest.add_particlespawner({
      		amount = 2,
		      time = 1,
      		minpos = {x = pos.x - 1, y = pos.y + 0.5, z = pos.z - 1},
	      	maxpos = {x = pos.x + 1, y = pos.y + 0.5, z = pos.z + 1},
			   minvel = {x = 0.2, y = 0.2, z = 0.2},
	      	maxvel = {x = 0.4, y = 0.8, z = 0.4},
		      minacc = {x = -0.2, y = 0, z = -0.2},
	      	maxacc = {x = 0.2, y = 0.1, z = 0.2},
		      minexptime = 5,
		      maxexptime = 5,
	      	minsize = 10,
		      maxsize = 5,
	      	collisiondetection = true,
	      	vertical = false,
	      	texture = "tnt_smoke.png"
	      })
		end	
	end,
})

minetest.register_abm({
	label = "chemistry:air pollution",
	nodenames = {"chemistry:white_phosphorus"},
	neighbors = {"air", "group:igniter"},
	interval = 1.0,
	chance = 1,
	catch_up = true,
	action = function(pos, node)
		if minetest.find_node_near(pos, 1, "air") then

	   	minetest.add_particlespawner({
      		amount = 2,
		      time = 1,
      		minpos = {x = pos.x - 1, y = pos.y + 0.5, z = pos.z - 1},
	      	maxpos = {x = pos.x + 1, y = pos.y + 0.5, z = pos.z + 1},
			   minvel = {x = 0.2, y = 0.2, z = 0.2},
	      	maxvel = {x = 0.4, y = 0.8, z = 0.4},
		      minacc = {x = -0.2, y = 0, z = -0.2},
	      	maxacc = {x = 0.2, y = 0.1, z = 0.2},
		      minexptime = 5,
		      maxexptime = 5,
	      	minsize = 10,
		      maxsize = 5,
	      	collisiondetection = true,
	      	vertical = false,
	      	texture = "default_item_smoke.png"
	      })
		end	
	end,
})
end

if chemistry.node_particles == "Decreased" then
	minetest.register_abm({
		label = "chemistry:liquid nitrogen vaporation",
		nodenames = {"group:freezer"},
		neighbors = {"air"},
		interval = 2.0,
		chance = 1,
		catch_up = true,
		action = function(pos, node)
			if minetest.find_node_near(pos, 1, "air") then

	      	minetest.add_particlespawner({
	      		amount = 1,
			      time = 1,
	      		minpos = {x = pos.x - 1, y = pos.y + 0.5, z = pos.z - 1},
		      	maxpos = {x = pos.x + 1, y = pos.y + 0.5, z = pos.z + 1},
			      minvel = {x = 0.2, y = 0.2, z = 0.2},
	      		maxvel = {x = 0.4, y = 0.8, z = 0.4},
		      	minacc = {x = -0.2, y = 0, z = -0.2},
	      		maxacc = {x = 0.2, y = 0.1, z = 0.2},
		      	minexptime = 2,
		      	maxexptime = 2,
	      		minsize = 1,
		      	maxsize = 3,
	      		collisiondetection = true,
	      		vertical = false,
	      		texture = "default_item_smoke.png"
	      	})
			end	
		end,
	})

minetest.register_abm({
	label = "chemistry:air pollution",
	nodenames = {"group:fire"},
	neighbors = {"group:flammable", "group:anthracite_material"},
	interval = 2.0,
	chance = 1,
	catch_up = true,
	action = function(pos, node)
		if minetest.find_node_near(pos, 1, "air") then

	   	minetest.add_particlespawner({
      		amount = 1,
		      time = 1,
      		minpos = {x = pos.x - 1, y = pos.y + 0.5, z = pos.z - 1},
	      	maxpos = {x = pos.x + 1, y = pos.y + 0.5, z = pos.z + 1},
			   minvel = {x = 0.2, y = 0.2, z = 0.2},
	      	maxvel = {x = 0.4, y = 0.8, z = 0.4},
		      minacc = {x = -0.2, y = 0, z = -0.2},
	      	maxacc = {x = 0.2, y = 0.1, z = 0.2},
		      minexptime = 5,
		      maxexptime = 5,
	      	minsize = 7,
		      maxsize = 5,
	      	collisiondetection = true,
	      	vertical = false,
	      	texture = "tnt_smoke.png"
	      })
		end	
	end,
})

minetest.register_abm({
	label = "chemistry:air pollution",
	nodenames = {"chemistry:white_phosphorus"},
	neighbors = {"air", "group:igniter"},
	interval = 2.0,
	chance = 1,
	catch_up = true,
	action = function(pos, node)
		if minetest.find_node_near(pos, 1, "air") then

	   	minetest.add_particlespawner({
      		amount = 1,
		      time = 1,
      		minpos = {x = pos.x - 1, y = pos.y + 0.5, z = pos.z - 1},
	      	maxpos = {x = pos.x + 1, y = pos.y + 0.5, z = pos.z + 1},
			   minvel = {x = 0.2, y = 0.2, z = 0.2},
	      	maxvel = {x = 0.4, y = 0.8, z = 0.4},
		      minacc = {x = -0.2, y = 0, z = -0.2},
	      	maxacc = {x = 0.2, y = 0.1, z = 0.2},
		      minexptime = 5,
		      maxexptime = 5,
	      	minsize = 7,
		      maxsize = 5,
	      	collisiondetection = true,
	      	vertical = false,
	      	texture = "default_item_smoke.png"
	      })
		end	
	end,
})
end
