mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-25 16:53:46 +01:00
Fix syntax error & indentation
This commit is contained in:
parent
f14aef3899
commit
82f0e2942a
12
data.lua
12
data.lua
@ -1,19 +1,19 @@
|
|||||||
minetest.mkdir(minetest.get_worldpath().."/data")
|
minetest.mkdir(minetest.get_worldpath().."/data")
|
||||||
function create_mod_storage(modname)
|
function create_mod_storage(modname)
|
||||||
minetest.mkdir(minetest.get_worldpath().."/data/"..modname)
|
minetest.mkdir(minetest.get_worldpath().."/data/"..modname)
|
||||||
|
end
|
||||||
function get_path(modname, filename)
|
function get_path(modname, filename)
|
||||||
return minetest.get_worldpath().."/data/"..modname.."/"..filename
|
return minetest.get_worldpath().."/data/"..modname.."/"..filename
|
||||||
|
end
|
||||||
function load(modname, filename)
|
function load(modname, filename)
|
||||||
return minetest.deserialize(modlib.file.read(get_path(modname, filename)..".lua"))
|
return minetest.deserialize(modlib.file.read(get_path(modname, filename)..".lua"))
|
||||||
|
end
|
||||||
function save(modname, filename, stuff)
|
function save(modname, filename, stuff)
|
||||||
return modlib.file.write(get_path(modname, filename)..".lua", minetest.serialize(stuff))
|
return modlib.file.write(get_path(modname, filename)..".lua", minetest.serialize(stuff))
|
||||||
|
end
|
||||||
function load_json(modname, filename)
|
function load_json(modname, filename)
|
||||||
return minetest.parse_json(modlib.file.read(get_path(modname, filename)..".json") or "null")
|
return minetest.parse_json(modlib.file.read(get_path(modname, filename)..".json") or "null")
|
||||||
|
end
|
||||||
function save_json(modname, filename, stuff)
|
function save_json(modname, filename, stuff)
|
||||||
return modlib.file.write(get_path(modname, filename)..".json", minetest.write_json(stuff))
|
return modlib.file.write(get_path(modname, filename)..".json", minetest.write_json(stuff))
|
||||||
|
end
|
2
init.lua
2
init.lua
@ -36,7 +36,7 @@ end
|
|||||||
|
|
||||||
modlib = {
|
modlib = {
|
||||||
-- TODO bump on release
|
-- TODO bump on release
|
||||||
version = 54,
|
version = 55,
|
||||||
dir_delim = rawget(_G, "DIR_DELIM") or "/",
|
dir_delim = rawget(_G, "DIR_DELIM") or "/",
|
||||||
_RG = setmetatable({}, {
|
_RG = setmetatable({}, {
|
||||||
__index = function(_, index)
|
__index = function(_, index)
|
||||||
|
Loading…
Reference in New Issue
Block a user