Solved Ambiguous Call of #getOnlinePlayers();

Discussion in 'Plugin Help/Development/Requests' started by nverdier, Feb 1, 2015.

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

    nverdier

    I am using Intellij IDEA as my IDE, and I have only the CraftBukkit library, as can be seen here. I always get an "ambiguous method call", which can be seen here. I see no reason as to why this should be happening. I am not using Maven, so I don't have a pom.xml. Of course it doesn't affect the final product, but it's still annoying, and shouldn't be happening (right?).
     
  2. Offline

    pie_flavor

    @nverdier Perhaps use the Bukkit API instead of the CraftBukkit jar.
     
  3. Offline

    nverdier

    Hmm... That does seem to fix it. I still just don't get why it's happening for CraftBukkit... Anyhow, I suppose this is solved.
     
  4. @nverdier It's happening because someone made the method deprecated.
     
  5. Offline

    nverdier

    @bwfcwalshy No, it's not about the deprecation, is saying that there's two different matches for the method...
     
  6. Offline

    teej107

    @nverdier Always build against the Bukkit API and then CB if you are using NMS.
     
  7. Offline

    nverdier

    @teej107 Of course, but I am using NMS in this case, and need CB, but I don't understand why it's happening...
     
  8. Offline

    teej107

    @nverdier Always put Bukkit in your build dependencies and always have it above CB if you are using CB.
     
  9. Offline

    pie_flavor

    @nverdier Look in the javadoc. Do you see those methods that begin with _INVALID_? Notice how they say that they exist for legacy reasons and will not exist at runtime? Those are the "ambiguous" methods you are encountering in CraftBukkit, and they don't start with _INVALID_.
     
  10. Offline

    nverdier

  11. Offline

    pie_flavor

    @nverdier Nope. The single getOnlinePlayers() should overwrite both of them.
    How did they even get that to compile?
     
Thread Status:
Not open for further replies.

Share This Page