Rename main table

master
Jordan Irwin 2021-06-01 20:37:46 -07:00
parent bdde7bfac3
commit 0805b84721
2 changed files with 22 additions and 22 deletions

View File

@ -18,10 +18,10 @@
local S = core.get_translator("shark")
shark = {
cmer_shark = {
modname = core.get_current_modname()
}
shark.modpath = core.get_modpath(shark.modname)
cmer_shark.modpath = core.get_modpath(cmer_shark.modname)
local version = "1.0"
local variant = "me" -- Creatures MOB-Engine
@ -35,9 +35,9 @@ local function mlog(lvl, msg)
end
if lvl == nil then
core.log("[" .. shark.modname .. "] " .. msg)
core.log("[" .. cmer_shark.modname .. "] " .. msg)
else
core.log(lvl, "[" .. shark.modname .. "] " .. msg)
core.log(lvl, "[" .. cmer_shark.modname .. "] " .. msg)
end
end
@ -52,7 +52,7 @@ local scripts = {
}
for _, script in ipairs(scripts) do
dofile(shark.modpath .. "/" .. script .. ".lua")
dofile(cmer_shark.modpath .. "/" .. script .. ".lua")
end
@ -135,13 +135,13 @@ local shark_def = {
spawn_on = spawn_nodes,
neighbors = {"default:water_source", "default:water_flowing",},
},
abm_interval = shark.interval,
abm_chance = shark.chance,
abm_interval = cmer_shark.interval,
abm_chance = cmer_shark.chance,
--max_number = 1,
number = 1,
time_range = {min=shark.min_time, max=shark.max_time},
light = {min=shark.min_light, max=shark.max_light},
height_limit = {min=shark.min_height, max=shark.max_height},
time_range = {min=cmer_shark.min_time, max=cmer_shark.max_time},
light = {min=cmer_shark.min_light, max=cmer_shark.max_light},
height_limit = {min=cmer_shark.min_height, max=cmer_shark.max_height},
},
}

View File

@ -2,14 +2,14 @@
--- Interval in seconds that specifies how often shark spawns.
--
-- @setting shark.interval
shark.interval = tonumber(core.settings:get("shark.interval")) or 60
cmer_shark.interval = tonumber(core.settings:get("shark.interval")) or 60
--- Chance for each node of spawning shark at each interval.
--
-- The value is inverted. So a chance of value of 5000 equals 1/5000.
--
-- @setting shark.chance
shark.chance = tonumber(core.settings:get("shark.chance")) or 5000
cmer_shark.chance = tonumber(core.settings:get("shark.chance")) or 5000
--- Minimum node light required for spawning.
--
@ -17,7 +17,7 @@ shark.chance = tonumber(core.settings:get("shark.chance")) or 5000
-- See: [Node definition] light_source
--
-- @setting shark.min_light
shark.min_light = tonumber(core.settings:get("shark.min_light")) or 4
cmer_shark.min_light = tonumber(core.settings:get("shark.min_light")) or 4
--- Maximum node light required for spawning.
--
@ -25,17 +25,17 @@ shark.min_light = tonumber(core.settings:get("shark.min_light")) or 4
-- See: [Node definition] light_source
--
-- @setting shark.max_light
shark.max_light = tonumber(core.settings:get("shark.max_light")) or core.LIGHT_MAX
cmer_shark.max_light = tonumber(core.settings:get("shark.max_light")) or core.LIGHT_MAX
--- Minimum height at which shark can spawn.
--
-- @setting shark.min_height
shark.min_height = tonumber(core.settings:get("shark.min_height")) or -500
cmer_shark.min_height = tonumber(core.settings:get("shark.min_height")) or -500
--- Maximum height at which shark can spawn.
--
-- @setting shark.max_height
shark.max_height = tonumber(core.settings:get("shark.max_height")) or 500
cmer_shark.max_height = tonumber(core.settings:get("shark.max_height")) or 500
--- Times that shark can spawn.
--
@ -47,12 +47,12 @@ shark.max_height = tonumber(core.settings:get("shark.max_height")) or 500
-- @setting shark.spawn_time
local spawn_time = core.settings:get("shark.spawn_time") or "any"
shark.min_time = 0
shark.max_time = 23999
cmer_shark.min_time = 0
cmer_shark.max_time = 23999
if spawn_time == "day" then
shark.min_time = 6000
shark.max_time = 19000
cmer_shark.min_time = 6000
cmer_shark.max_time = 19000
elseif spawn_time == "night" then
shark.min_time = 19500
shark.max_time = 4500
cmer_shark.min_time = 19500
cmer_shark.max_time = 4500
end