User Tools

Site Tools


tutorial:persistent_states

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:persistent_states [2025/07/28 20:33] – Begin update to 1.21.5 the...why...even...howtutorial:persistent_states [2025/11/18 03:33] (current) cassiancc
Line 329: Line 329:
 </code> </code>
  
-Note: We create a ''**HashMap**'' of ''**UUID**'''s to ''**PlayereData**'''s. If you don't know what a hashmap does: you give them a 'key', in our case a ''**UUID**'' and they give you back something, in our case ''**PlayerData**''. The reason we use ''**UUID**'''s is because every player that connects to our 'server' has a unique ''**UUID**'' that //only// they are associated with. This lets us differentiate between different players and lets us 'pull' the right data for them. (Or create it if it doesn't exist yet).+Note: We create a ''**HashMap**'' of ''**UUID**'''s to ''**PlayerData**'''s. If you don't know what a hashmap does: you give them a 'key', in our case a ''**UUID**'' and they give you back something, in our case ''**PlayerData**''. The reason we use ''**UUID**'''s is because every player that connects to our 'server' has a unique ''**UUID**'' that //only// they are associated with. This lets us differentiate between different players and lets us 'pull' the right data for them. (Or create it if it doesn't exist yet).
  
 Let's add a utility function to ''**StateSaverAndLoader**'' which will take a ''**LivingEntity**'' and return the associated ''**PlayerData**'' in our '''**HashMap**'''. Let's add a utility function to ''**StateSaverAndLoader**'' which will take a ''**LivingEntity**'' and return the associated ''**PlayerData**'' in our '''**HashMap**'''.
tutorial/persistent_states.txt · Last modified: 2025/11/18 03:33 by cassiancc