Solved Eclipse doesn't use the new getOnlinePlayers()

Discussion in 'Plugin Development' started by Panjab, Oct 21, 2014.

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

    Panjab

    Hey there!

    As you might've known, Bukkit changed the return type of getOnlinePlayers() from a Player[] to a Collection<? extend Player> some time ago.
    But unfortunately, my Eclipse always imports/uses the Array-Method, even though I am clicking on the method returning the Collection.

    Removing the imports, creating a variable and all that stuff doesn't work. It just wont stop using the Array.

    Hope you can help me.
     
  2. Offline

    teej107

    Are you using a version of Bukkit that still uses the array method?
     
  3. Offline

    Panjab

    teej107 I am using a version which includes both of them, the deprecated and the new one.
     
  4. Offline

    teej107

    Panjab A single version won't include both of them. What version(s) are you using?
     
  5. Offline

    Panjab

    It says 'v_1.7_R4', so I'm really not sure what version it exactly is.
    But it definitely supports both methods:

    [​IMG]

    teej107
     
  6. Offline

    teej107

    Panjab Go into your build path and look what version you are building against. One thing, unless you are using NMS, don't use CraftBukkit, use Bukkit.
     
  7. Offline

    Panjab

    Okay, however, it suddenly started using the right method.
    Thanks for helping though, teej107.
     
Thread Status:
Not open for further replies.

Share This Page