Add LuaDoc

This commit is contained in:
Jordan Irwin 2021-05-08 21:18:33 -07:00
parent 62175d6a75
commit 2210eff6bc
2 changed files with 35 additions and 14 deletions

@ -1,23 +1,30 @@
-- Settings for sneeker mod
--- Settings for sneeker mod.
--
-- @module settings.lua
local time_min = 60 local time_min = 60
--- How long (in seconds) sneeker remains in world after spawn. --- How long (in seconds) sneeker remains in world after spawn.
-- --
-- Default: 15 minutes
--
-- @setting sneeker.lifespan -- @setting sneeker.lifespan
-- @settype int
-- @default 900 (15 minutes)
sneeker.lifetime = tonumber(core.settings:get("sneeker.lifetime") or time_min * 15) sneeker.lifetime = tonumber(core.settings:get("sneeker.lifetime") or time_min * 15)
--- Loudness of explosion. --- Loudness of explosion.
-- --
-- @setting sneeker.boom_gain -- @setting sneeker.boom_gain
-- @settype float
-- @default 1.5
sneeker.boom_gain = tonumber(core.settings:get("sneeker.boom_gain") or 1.5) sneeker.boom_gain = tonumber(core.settings:get("sneeker.boom_gain") or 1.5)
--- Determines whether or not a player must be close for spawn to occur. --- Determines whether or not a player must be close for spawn to occur.
-- --
-- @setting sneeker.spawn_require_player_nearby -- @setting sneeker.spawn_require_player_nearby
-- @settype bool
-- @default true
sneeker.spawn_require_player_nearby = core.settings:get_bool("sneeker.spawn_require_player_nearby", true) sneeker.spawn_require_player_nearby = core.settings:get_bool("sneeker.spawn_require_player_nearby", true)
--- Distance in nodes a player must be for spawn to occur. --- Distance in nodes a player must be for spawn to occur.
@ -25,11 +32,15 @@ sneeker.spawn_require_player_nearby = core.settings:get_bool("sneeker.spawn_requ
-- Only used if `sneeker.spawn_require_player_nearby` enabled. -- Only used if `sneeker.spawn_require_player_nearby` enabled.
-- --
-- @setting sneeker.spawn_player_radius -- @setting sneeker.spawn_player_radius
-- @settype int
-- @default 100
sneeker.spawn_player_radius = tonumber(core.settings:get("sneeker.spawn_player_radius") or 100) sneeker.spawn_player_radius = tonumber(core.settings:get("sneeker.spawn_player_radius") or 100)
--- If enabled, mobs not near any players will despawn. --- If enabled, mobs not near any players will despawn.
-- --
-- @setting sneeker.despawn_player_far -- @setting sneeker.despawn_player_far
-- @settype bool
-- @default true
sneeker.despawn_player_far = core.settings:get_bool("sneeker.despawn_player_far", true) sneeker.despawn_player_far = core.settings:get_bool("sneeker.despawn_player_far", true)
--- Distance determining if a player is near enough to prevent despawn. --- Distance determining if a player is near enough to prevent despawn.
@ -37,6 +48,8 @@ sneeker.despawn_player_far = core.settings:get_bool("sneeker.despawn_player_far"
-- Only used if `sneeker.despawn_player_far` enabled. -- Only used if `sneeker.despawn_player_far` enabled.
-- --
-- @setting sneeker.despawn_player_radius -- @setting sneeker.despawn_player_radius
-- @settype int
-- @default 500
sneeker.despawn_player_radius = tonumber(core.settings:get("sneeker.despawn_player_radius") or 500) sneeker.despawn_player_radius = tonumber(core.settings:get("sneeker.despawn_player_radius") or 500)
--- Sets possibility for spawn. --- Sets possibility for spawn.
@ -44,44 +57,52 @@ sneeker.despawn_player_radius = tonumber(core.settings:get("sneeker.despawn_play
-- Inverted value (e.g. 10000 = 1/10000). -- Inverted value (e.g. 10000 = 1/10000).
-- --
-- @setting sneeker.spawn_chance -- @setting sneeker.spawn_chance
-- @settype int
-- @default 10000
sneeker.spawn_chance = tonumber(core.settings:get("sneeker.spawn_chance") or 10000) sneeker.spawn_chance = tonumber(core.settings:get("sneeker.spawn_chance") or 10000)
--- Sets frequency of spawn chance. --- Sets frequency of spawn chance.
-- --
-- Default 240 is equivalent to 4 minutes (60 * 4).
--
-- @setting sneeker.spawn_interval -- @setting sneeker.spawn_interval
-- @settype int
-- @default 240 (4 minutes)
sneeker.spawn_interval = tonumber(core.settings:get("sneeker.spawn_interval") or time_min * 4) sneeker.spawn_interval = tonumber(core.settings:get("sneeker.spawn_interval") or time_min * 4)
--- Sets the minimum light that a node must have for spawn to occur. --- Sets the minimum light that a node must have for spawn to occur.
-- --
-- Default: 0 -- Value can be set between 0 (no light) & 15 (max light).
-- --
-- @setting sneeker.spawn_minlight -- @setting sneeker.spawn_minlight
-- @settype int
-- @default 0
sneeker.spawn_minlight = tonumber(core.settings:get("sneeker.spawn_minlight") or 0) sneeker.spawn_minlight = tonumber(core.settings:get("sneeker.spawn_minlight") or 0)
--- Sets the maximum light that a node can have for spawn to occur. --- Sets the maximum light that a node can have for spawn to occur.
-- --
-- Default: 4 -- Value can be set between 0 (no light) & 15 (max light).
-- --
-- @setting sneeker.spawn_maxlight -- @setting sneeker.spawn_maxlight
-- @settype int
-- @default 4
sneeker.spawn_maxlight = tonumber(core.settings:get("sneeker.spawn_maxlight") or 4) sneeker.spawn_maxlight = tonumber(core.settings:get("sneeker.spawn_maxlight") or 4)
--- Sets the lowest position at which sneeker can spawn. --- Sets the lowest position at which sneeker can spawn.
-- --
-- Default: -31000
--
-- @setting sneeker.spawn_minheight -- @setting sneeker.spawn_minheight
-- @settype int
-- @default -31000
sneeker.spawn_minheight = tonumber(core.settings:get("sneeker.spawn_minheight") or -31000) sneeker.spawn_minheight = tonumber(core.settings:get("sneeker.spawn_minheight") or -31000)
--- Sets the highest position at which sneeker can spawn. --- Sets the highest position at which sneeker can spawn.
-- --
-- Default: 31000
--
-- @setting sneeker.spawn_maxheight -- @setting sneeker.spawn_maxheight
-- @settype int
-- @default 31000
sneeker.spawn_maxheight = tonumber(core.settings:get("sneeker.spawn_maxheight") or 31000) sneeker.spawn_maxheight = tonumber(core.settings:get("sneeker.spawn_maxheight") or 31000)
--- Limits the number of entities that can spawn per mapblock (16x16x16). --- Limits the number of entities that can spawn per mapblock (16x16x16).
-- --
-- Default: 1 -- @setting sneeker.spawn_mapblock_limit
-- @settype int
-- @default 1
sneeker.spawn_mapblock_limit = tonumber(core.settings:get("sneeker.spawn_mapblock_limit") or 1) sneeker.spawn_mapblock_limit = tonumber(core.settings:get("sneeker.spawn_mapblock_limit") or 1)

@ -37,10 +37,10 @@ sneeker.spawn_chance (Sneeker spawn chance) int 10000
sneeker.spawn_interval (Sneeker spawn interval) int 240 sneeker.spawn_interval (Sneeker spawn interval) int 240
# Sets the minimum light that a node must have for spawn to occur. # Sets the minimum light that a node must have for spawn to occur.
sneeker.spawn_minlight (Sneeker min light for spawn) int 0 sneeker.spawn_minlight (Sneeker min light for spawn) int 0 0 15
# Sets the maximum light that a node can have for spawn to occur. # Sets the maximum light that a node can have for spawn to occur.
sneeker.spawn_maxlight (Sneeker max light for spawn) int 4 sneeker.spawn_maxlight (Sneeker max light for spawn) int 4 0 15
# Sets the lowest position at which sneeker can spawn. # Sets the lowest position at which sneeker can spawn.
sneeker.spawn_minheight (Sneeker min spawn height) int -31000 sneeker.spawn_minheight (Sneeker min spawn height) int -31000