Solved HashMap and OfflinePlayer

Discussion in 'Plugin Development' started by L33m4n123, Sep 15, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    L33m4n123

    Hey!

    I read here and there that storing a Player object in a hashmap can lead to Memory Leaks.

    Does the same counts for OfflinePlayer?
     
  2. Offline

    Pizza371

    L33m4n123 I don't know for sure, but im 99% sure it would be the same, they are both players right?
    But why would you want to store an OfflinePlayer in a hashmap?
     
  3. Offline

    L33m4n123

    Pizza371
    For Scoreboards that have a few stats. Since I call them via a Fake user as OfflinePlayer .. Will simply save their Name then. Means more to type for me but I am on the save side. ty
     
  4. Offline

    Janmm14

    L33m4n123
    Well I think storing OfflinePlayers do not cause memory leaks (except if they were already online), because the OfflinePlayer has no inventory, no potion effects, no world, just the bedspawnlocation if they were online once.
     
Thread Status:
Not open for further replies.

Share This Page