Persistence via player:set_attribute

master
Ben Deutsch 2017-08-03 06:53:20 +02:00
parent 060c0c3825
commit e8b7ecdf62
1 changed files with 10 additions and 1 deletions

View File

@ -114,6 +114,15 @@ minetest.register_chatcommand("clouds", {
player:set_clouds(settings)
settings = player:get_clouds()
return true, "Clouds set " .. format_clouds(settings)
local cloudstring = format_clouds(settings)
player:set_attribute('cloudcontrol:settings', cloudstring)
return true, "Clouds set " .. cloudstring
end,
})
minetest.register_on_joinplayer(function(player)
local cloudstring = player:get_attribute('cloudcontrol:settings')
if cloudstring then
player:set_clouds(parse_clouds(cloudstring))
end
end)