forked from Mirrorlandia_minetest/mod-sneeker
Use setting 'sneeker.spawn_maxlight' to determine node light for spawn
This commit is contained in:
parent
439646417a
commit
a5025cdfb8
@ -2,4 +2,9 @@
|
|||||||
|
|
||||||
|
|
||||||
sneeker.debug = minetest.settings:get_bool("sneeker.debug", false)
|
sneeker.debug = minetest.settings:get_bool("sneeker.debug", false)
|
||||||
|
|
||||||
|
-- Maximum number of spawns active at one time
|
||||||
sneeker.spawn_cap = tonumber(minetest.settings:get("sneeker.spawn_cap")) or 25
|
sneeker.spawn_cap = tonumber(minetest.settings:get("sneeker.spawn_cap")) or 25
|
||||||
|
|
||||||
|
-- Maximum light of node for spawn
|
||||||
|
sneeker.spawn_maxlight = tonumber(minetest.settings:get("sneeker.spawn_maxlight")) or 5
|
||||||
|
@ -10,3 +10,6 @@ sneeker.spawn_chance (Spawn chance) int 18000
|
|||||||
# Sets frequency of spawn chance.
|
# Sets frequency of spawn chance.
|
||||||
# Default 1200 is equivalent to 20 minutes (60 * 40).
|
# Default 1200 is equivalent to 20 minutes (60 * 40).
|
||||||
sneeker.spawn_interval (Spawn interval) int 2400
|
sneeker.spawn_interval (Spawn interval) int 2400
|
||||||
|
|
||||||
|
# Sets the maximum light that a node can have for spawn to occur.
|
||||||
|
sneeker.spawn_maxlight (Max light for spawn) int 5
|
||||||
|
@ -26,7 +26,7 @@ minetest.register_abm({
|
|||||||
if not minetest.get_node_light(pos) then
|
if not minetest.get_node_light(pos) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if minetest.get_node_light(pos) > 5 then
|
if minetest.get_node_light(pos) > sneeker.spawn_maxlight then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if minetest.get_node_light(pos) < -1 then
|
if minetest.get_node_light(pos) < -1 then
|
||||||
|
Loading…
Reference in New Issue
Block a user