[SOLVED] ambiguous for type player

Discussion in 'Spigot Plugin Development' started by AdrianPMC, Jun 22, 2015.

  1. yes I know I have read the thread on bybukkit about I didnt break your plugins and abambiguous for type player but this isnt about getHealth.... I can fix that by using bukkit intinstead of craftbukkit, but when I do it makes p.getMaxHealth () ambiguous, I get home in 20 mins, and I will edit to post to get the exact code just checking if there is anyone that knows how to fix this without knowing the code (llike if its happend to you or something ) all help appreciated :)
     
  2. You need both craftbukkit and spigot
     
  3. EDIT: Added both, fixed both p.getHealth() and p.getMaxHealth() just had to order bucket above craftbukkit, BUT there is one more ambiguous case that is now fixed xD

    Code (Text):
    Block b = player.getTargetBlock(null, 5);
    getTargetBlock is ambiguous to the type player :/

    im stuck on how to fix this
     
    #3 AdrianPMC, Jun 22, 2015
    Last edited: Jun 22, 2015
  4. again another update, i tried this, just checking with people if it will return any errors in game?

    Code (Text):
    Block b = player.getTargetBlock((Set<Material>)null, 5);
     
  5. I guess you're casting null so the compiler can decide which of the two ambiguous methods to call, It should work.