Hey there! Sorry this may be a really stupid question but I've been baffling over trying to create a PersistentStateType that manages player inventories across server restarts so I can keep track of what their inventories are in certain worlds. I'm storing it as a public Map<UUID, Map<RegistryKey<World>, InventoryData>> playerInventories = new HashMap<>(); and as such can't use a primitive type Codec to store said data. Following this documentation: https://wiki.fabricmc.net/tutorial:persistent_states I noticed there is a way to create persistentstate for any type as such I've tried but to no avail: It seems like this bit of fabric api got quite a bit of changes just based off how much it varies from mod to mod I've looked at. This is my first fabric mod so apologies if I'm missing something obvious here! More of a C# person as well so Java is giving me a run for my money with all the Optional bs checks I need to do and isPresent() is already giving me a headache 🤣
Any help is appreciated thanks!
I've also tried looking for the specific Type import that was used in the docs but I can only assume it was renamed to PersistentStateType as Type seems to be from base mojang or other classes that seem very unrelated.