#(tanko) Persist Map Objects in Citizens API

21 messages · Page 1 of 1 (latest)

subtle copper
#

Is there a way you can persist a Map within a Citizens trait? Do you just use getValuesDeep() and cast the value to whatever value your Object is?

uneven relicBOT
#

(tanko) Persist Map Objects in Citizens API

#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

lusty abyss
#

yes, using the @Persist annotation / deserialisers or doing it manually like you mention

#

@subtle copper

subtle copper
#

okay, is this saving/loading handled automatically when Citizens starts up and shuts down?

lusty abyss
#

with @Persist yes

subtle copper
#

got it, I was seeing the "load" function in the API and assumed that you had to load each @Persist key within that function

lusty abyss
#

nope, that's if you're not using @Persist

subtle copper
#

ah I see, for more complex datatypes?

lusty abyss
#

you need to specify the key / value types due to java type erasure but yes

subtle copper
#

okay, thanks, that has answered all my questions, much appreciated

sly stirrupBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@subtle copper