Casting from player to my custom player class.

Discussion in 'Plugin Development' started by Paxination, Jan 6, 2014.

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

    Paxination

    I am interested in learning how to get my custom player class to cast from Player. To stop with iterating through the hashmaps to find a players file. I am assuming i'll have to extend Player? But then my class is filled to the brim with all the other methods from Player.
     
  2. Offline

    xTrollxDudex

    Paxination
    Players aren't like entities in a way that you can't register them as the same Player, only a different instance of one.

    Edit: BTW, Player is an interface, so you need to implement it instead of extending it.
     
  3. Offline

    Paxination

    xTrollxDudex

    Yeah i figured that out after making this post that it has to be implemented and its an interface.

    So there isnt a better method than a hashmap to access my player class?
     
  4. Offline

    1Rogue

    You would still need to iterate to get any relevant information...
     
Thread Status:
Not open for further replies.

Share This Page