Restrict number of music players per village
This commit is contained in:
parent
7c0e69ef3f
commit
eea78b8f0a
@ -258,13 +258,17 @@ function village.spawn_chunk(pos, orient, replace, pr, chunktype, nofill)
|
|||||||
goodies.fill(pos, chunktype, pr, "main", 3)
|
goodies.fill(pos, chunktype, pr, "main", 3)
|
||||||
end, true)
|
end, true)
|
||||||
|
|
||||||
|
-- Restrict number of music players
|
||||||
|
local music = 0
|
||||||
util.nodefunc(
|
util.nodefunc(
|
||||||
pos,
|
pos,
|
||||||
{x = pos.x+12, y = pos.y+12, z = pos.z+12},
|
{x = pos.x+12, y = pos.y+12, z = pos.z+12},
|
||||||
"music:player",
|
"music:player",
|
||||||
function(pos)
|
function(pos)
|
||||||
if pr:next(1, 2) > 1 then
|
if music >= 1 or pr:next(1, 2) > 1 then
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
|
else
|
||||||
|
music = music + 1
|
||||||
end
|
end
|
||||||
end, true)
|
end, true)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user