Persistence via player:set_attribute
This commit is contained in:
parent
060c0c3825
commit
e8b7ecdf62
11
init.lua
11
init.lua
@ -114,6 +114,15 @@ minetest.register_chatcommand("clouds", {
|
|||||||
player:set_clouds(settings)
|
player:set_clouds(settings)
|
||||||
settings = player:get_clouds()
|
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,
|
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user