Default: add setting to disable liquid particles
You can set 'enable_liquid_particles=false' in .conf
This commit is contained in:
parent
b2d120f1a9
commit
40717d3f7e
@ -742,54 +742,56 @@ end
|
||||
-- Liquid particles
|
||||
--
|
||||
|
||||
local add_particlespawner = minetest.add_particlespawner
|
||||
local get_node = minetest.get_node
|
||||
local registered_nodes = minetest.registered_nodes
|
||||
if minetest.settings:get_bool("enable_liquid_particles") ~= false then
|
||||
local add_particlespawner = minetest.add_particlespawner
|
||||
local get_node = minetest.get_node
|
||||
local registered_nodes = minetest.registered_nodes
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Liquid particles",
|
||||
nodenames = {"group:liquid"},
|
||||
interval = 15,
|
||||
chance = 3,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local nname = node.name
|
||||
if get_node({x = pos.x, y = pos.y - 2, z = pos.z}).name == "air" then
|
||||
local tiles = registered_nodes[nname].tiles
|
||||
local texture = tiles[1]
|
||||
if texture.name ~= nil then
|
||||
texture = texture.name
|
||||
minetest.register_abm({
|
||||
label = "Liquid particles",
|
||||
nodenames = {"group:liquid"},
|
||||
interval = 15,
|
||||
chance = 3,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local nname = node.name
|
||||
if get_node({x = pos.x, y = pos.y - 2, z = pos.z}).name == "air" then
|
||||
local tiles = registered_nodes[nname].tiles
|
||||
local texture = tiles[1]
|
||||
if texture.name ~= nil then
|
||||
texture = texture.name
|
||||
end
|
||||
|
||||
add_particlespawner({
|
||||
amount = 5,
|
||||
time = 15,
|
||||
minpos = {x = pos.x - 0.5, y = pos.y - 1, z = pos.z - 0.5},
|
||||
maxpos = {x = pos.x + 0.5, y = pos.y - 1, z = pos.z + 0.5},
|
||||
minvel = {x = 0, y = -1, z = 0},
|
||||
maxvel = {x = 0, y = -1, z = 0},
|
||||
minexptime = 2,
|
||||
maxexptime = 4,
|
||||
vertical = true,
|
||||
texture = texture .. "^[resize:16x16^[mask:default_liquid_drop.png"
|
||||
})
|
||||
end
|
||||
|
||||
add_particlespawner({
|
||||
amount = 5,
|
||||
time = 15,
|
||||
minpos = {x = pos.x - 0.5, y = pos.y - 1, z = pos.z - 0.5},
|
||||
maxpos = {x = pos.x + 0.5, y = pos.y - 1, z = pos.z + 0.5},
|
||||
minvel = {x = 0, y = -1, z = 0},
|
||||
maxvel = {x = 0, y = -1, z = 0},
|
||||
minexptime = 2,
|
||||
maxexptime = 4,
|
||||
vertical = true,
|
||||
texture = texture .. "^[resize:16x16^[mask:default_liquid_drop.png"
|
||||
})
|
||||
if (nname == "default:lava_source" or nname == "default:lava_flowing")
|
||||
and get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then
|
||||
add_particlespawner({
|
||||
amount = 5,
|
||||
time = 15,
|
||||
minpos = {x = pos.x - 0.5, y = pos.y, z = pos.z - 0.5},
|
||||
maxpos = {x = pos.x + 0.5, y = pos.y, z = pos.z + 0.5},
|
||||
minvel = {x = 0, y = 1, z = 0},
|
||||
maxvel = {x = 0, y = 1, z = 0},
|
||||
minexptime = 2,
|
||||
maxexptime = 2,
|
||||
vertical = true,
|
||||
texture = "default_lava.png",
|
||||
glow = 3
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
if (nname == "default:lava_source" or nname == "default:lava_flowing")
|
||||
and get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then
|
||||
add_particlespawner({
|
||||
amount = 5,
|
||||
time = 15,
|
||||
minpos = {x = pos.x - 0.5, y = pos.y, z = pos.z - 0.5},
|
||||
maxpos = {x = pos.x + 0.5, y = pos.y, z = pos.z + 0.5},
|
||||
minvel = {x = 0, y = 1, z = 0},
|
||||
maxvel = {x = 0, y = 1, z = 0},
|
||||
minexptime = 2,
|
||||
maxexptime = 2,
|
||||
vertical = true,
|
||||
texture = "default_lava.png",
|
||||
glow = 3
|
||||
})
|
||||
end
|
||||
end
|
||||
})
|
||||
})
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user