adventures/encode.lua

16 lines
537 B
Lua
Raw Normal View History

2013-01-03 19:31:49 -08:00
local file = io.open(minetest.get_worldpath().."/adventures_sources", "w")
local saved = false
local str = ""
2013-01-03 19:31:49 -08:00
for pos,name in pairs(adventures.sources) do
local meta = minetest.env:get_meta(pos)
if(name == "adventures:invincible_source") then
str = str..name..","..pos.x..","..pos.y..","..pos.z..","..
2013-01-03 19:31:49 -08:00
meta:get_int("x")..","..meta:get_int("y")..","..meta:get_int("z")..","..
2013-01-08 19:14:11 -08:00
meta:get_int("width")..","..meta:get_int("length")..","..meta:get_int("height")
2013-01-03 19:31:49 -08:00
.."\n"
end
saved = true
end
file:write(str)
file:close()
return saved