The cuestion is simple, what is better?
Supposing we want to store useful data (Location, Homes, Money, Titles) of a player and request it when PlayerMoveEvent is called. Please considerate an high amount of player for each case.
Case A: Create a class what will store the custom player data, create a new instance of the class for each player and store it on a HashMap public variable and get the data from it when we need it (in the PlayerMoveEvent).
Case B: Store each data as individual keys in the PersistentDataContainer of each player and request it when we need it.
Case C: Create a new class from PersistentDataType, store it in the PersistentDataContainer of each player and request it when we need it.
Case D (half & half): Almost the same that A case but we add a reference pointer of the instance class with the data on the player's PersistentDataContainer.
Supposing we want to store useful data (Location, Homes, Money, Titles) of a player and request it when PlayerMoveEvent is called. Please considerate an high amount of player for each case.
Case A: Create a class what will store the custom player data, create a new instance of the class for each player and store it on a HashMap public variable and get the data from it when we need it (in the PlayerMoveEvent).
Case B: Store each data as individual keys in the PersistentDataContainer of each player and request it when we need it.
Case C: Create a new class from PersistentDataType, store it in the PersistentDataContainer of each player and request it when we need it.
Case D (half & half): Almost the same that A case but we add a reference pointer of the instance class with the data on the player's PersistentDataContainer.
Last edited: