Now, however, the savefile enters deduplication mode when writing an object (like say the player) to the file. Multiple references will automatically be detected and handled internally. You just have to make sure you read things back in the same order you wrote them for this to work correctly.
Also note that duplicates between two independent savefile operations will not be detected. For example, if you write player A and then later write player B, any references from the two players to the same object will not be detected. The two savefile entries are completely independent. (So you don't have to worry about the order you read them or the possibility of mangling one when you delete the other.)
However, suppose a player has two objects in hand when being saved. Even though the two objects are written in separate statements, these both take place inside the ongoing savefile operation that is writing the player. That means references to the same thing inside object 1 and object 2 _will_ be detected.