Solved Slight Issue with Player Joins and MPlayer

Discussion in 'Plugin Development' started by nbrandwine, Nov 8, 2015.

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

    nbrandwine

    Greetings,

    The intention of what I'm about to show you was not made to be pretty or efficient, as a starter. Anyways, the purpose of this section of my program was to check a players faction on join. My code is this,
    and my issue is.

    [​IMG]

    My console is:

    [​IMG]

    It says the cast is a problem, (CraftPlayer to MPlayer) but I think it should work!
     
  2. Offline

    Zombie_Striker

    @nbrandwine
    No, it shouldn't. The class Player does not extend or implement MPlayer, so you cant cast it.

    May we see your MPlayer class?
     
  3. Offline

    nbrandwine

  4. Offline

    Zombie_Striker

    @nbrandwine
    Thank you for that link, though you should have also read it yourself :

    // Fetching the data is this simple.
    mplayer=MPlayer.get(uuidString);
    mplayer=MPlayer.get(uuid);
    mplayer=MPlayer.get(commandSender);
    mplayer=MPlayer.get(player);
     
    nbrandwine likes this.
  5. Offline

    nbrandwine

    Yeah, I tried to do it the cast way as I've seen it before.
    I'll give this a run and see how it goes. Thank you.

    It works. Thank you SO much, @Zombie_Striker. I should have foreseen this issue...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 8, 2015
Thread Status:
Not open for further replies.

Share This Page