Storing players as objects

Discussion in 'Plugin Development' started by Samthelord1, Aug 18, 2013.

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

    Samthelord1

    now, I know most people say "don't store players as objects!" but I have done it previously and I know how to work with it, but my question has to do with referencing a player as different objects as different classes.
    I am currently developing a plugin, and I have my main class, that references a player as int1 and I am succesfully adding him to a list, I am then making the list static and importing it into my other class, but in this class, I am listening for different events, and referencing the player as damager, and then checking if damager is in the List that I imported, I'm wondering if this will work and if there is a better method to use. Help is appreciated.
     
  2. Show full code please, or add some more details to your question.
     
  3. Offline

    xTrollxDudex

    Samthelord1
    The player object sort of... Works differently than normal classes. As from ferrybig 's sig, it says "causes memory leaks". Why you may ask? The player object is stored with the world along with everything else, if you don't handle the player object with leaving, and track him correctly, chances are that it will still be stored in memory, keeping the chunks in the world loaded, and causing memory leaks.
     
Thread Status:
Not open for further replies.

Share This Page