hell/init.lua

36 lines
1.2 KiB
Lua

local S
if minetest.get_translator ~= nil then
S = minetest.get_translator("hell")
else
-- mock the translator function for MT 0.4
S = function(str, ...)
local args={...}
return str:gsub(
"@%d+",
function(match) return args[tonumber(match:sub(2))] end
)
end
end
-- Global Hell namespace
hell = {}
hell.modname = minetest.get_current_modname()
hell.path = minetest.get_modpath(hell.modname)
hell.get_translator = S
-- Settings
hell.DEPTH = -19640 -- The y location of the Hell
hell.FASTTRAVEL_FACTOR = 10 -- 10 could be better value for Minetest, since there's no sprint, but ex-Minecraft players will be mathing for 8
hell.HELL_REALM_ENABLED = true -- Setting to false disables the Hell and Hell portal
-- Override default settings with values from the .conf file, if any are present.
hell.FASTTRAVEL_FACTOR = tonumber(minetest.settings:get("hell_fasttravel_factor") or hell.FASTTRAVEL_FACTOR)
hell.HELL_REALM_ENABLED = minetest.settings:get_bool("hell_realm_enabled", hell.HELL_REALM_ENABLED) or hell.HELL_REALM_ENABLED
-- Load files
if hell.HELL_REALM_ENABLED then
dofile(hell.path .. "/hell.lua")
end