Namespacing pt. 3
This commit is contained in:
@@ -36,7 +36,7 @@ terumet = {}
|
||||
terumet.version = {major=3, minor=0, patch=0}
|
||||
local ver = terumet.version
|
||||
terumet.version_text = ver.major .. '.' .. ver.minor .. '.' .. ver.patch
|
||||
terumet.mod_name = "terumet"
|
||||
terumet.mod_name = ":terumet"
|
||||
|
||||
-- this isn't the suggested way to check for game version but... it works for my purposes
|
||||
terumet.legacy = minetest.get_version().string:find('0.4')
|
||||
@@ -162,7 +162,7 @@ function terumet.format_time(t)
|
||||
end
|
||||
|
||||
function terumet.do_lua_file(name)
|
||||
dofile(minetest.get_modpath(terumet.mod_name) .. '/' .. name .. '.lua')
|
||||
dofile(minetest.get_modpath("ip_terumet") .. '/' .. name .. '.lua')
|
||||
end
|
||||
|
||||
-- create a copy of node groups from an unlit machine for lit version of machine
|
||||
@@ -216,10 +216,12 @@ function terumet.tex(id)
|
||||
-- accepts both base ids (assuming this mod) and full mod ids
|
||||
-- ex: terumet.tex('ingot_raw') -> 'terumet_ingot_raw.png'
|
||||
-- terumet.tex('default:cobble') -> 'default_cobble.png'
|
||||
|
||||
if id:match(':') then
|
||||
id = id:sub(2)
|
||||
return string.format('%s.png', id:gsub(':', '_'))
|
||||
else
|
||||
return string.format('%s_%s.png', terumet.mod_name, id)
|
||||
return string.format('%s_%s.png', "terumet", id)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user