Use setting 'sneeker.spawn_maxlight' to determine node light for spawn

This commit is contained in:
AntumDeluge 2017-05-29 01:00:39 -07:00 committed by Jordan Irwin
parent 439646417a
commit a5025cdfb8
3 changed files with 9 additions and 1 deletions

@ -2,4 +2,9 @@
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
-- 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.
# Default 1200 is equivalent to 20 minutes (60 * 40).
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
return
end
if minetest.get_node_light(pos) > 5 then
if minetest.get_node_light(pos) > sneeker.spawn_maxlight then
return
end
if minetest.get_node_light(pos) < -1 then