Error compiling against newest 1.9.4 version

Discussion in 'Spigot Plugin Development' started by Jalau, May 16, 2016.

  1. I have checked everything, I have the newest 1.9.4 jar and my IDE shows no error in that class file. But when I try to compile my plugin it says:
    Code (Text):
    Error:(41, 68) java: cannot access net.minecraft.server.v1_9_R2.PacketPlayOutPlayerInfo.PlayerInfoData
      bad class file: A:\IDE\Build Path\spigot-1.9.4.jar(net/minecraft/server/v1_9_R2/PacketPlayOutPlayerInfo$PlayerInfoData.class)
        bad RuntimeInvisibleParameterAnnotations attribute: PlayerInfoData(com.mojang.authlib.GameProfile,int,net.minecraft.server.v1_9_R2.WorldSettings.EnumGamemode,net.minecraft.server.v1_9_R2.IChatBaseComponent)
        Please remove or make sure it appears in the correct subdirectory of the classpath.
    Does anyone have a solution? Currently I deleted the whole build tools folder and I'm redownloading everything to exclude any mistake on my side.
     
  2. buildpath isnt found.
     
  3. What do you mean by compiling? Maven?

    You probably just have your project configured improperly or are using a buggy IDE.
     
  4. Build path
     
  5. I'm using IntelliJ if that helps. And what do I need to change? IntelliJ shows no error in that class file and compiling the other classes seems to work fine.
     
  6. Somewhere in the horror that is the intelliJ artifact menu, you have bad config or paths (or it is just broken).

    Trying to compile in intelliJ is a nightmare, from personal experience. It is extremely user-unfriendly and does nothing to tell you when any of the cryptic settings is wrong.
    I spent a week trying to get it to work - it worked fine for normal programs - and could never get it to export a plugin without errors, it just hates the idea of libraries not being compiled into the jar.
     
  7. It worked perfectely fine for me. Is it impossible that @md_5 and his crew screwed something up on their end? Does
    PacketPlayOutPlayerInfo.PlayerInfoData +
    import net.minecraft.server.v1_9_R2.PacketPlayOutPlayerInfo; compile fine against the newest build for you?
     
  8. I recommend the use of a build manager. Maven and Gradle are quite popular and make packaging libraries (both externally and interally) very simple. It doesn't take long to setup and there's TONS of documentation for both of them. If you haven't used either, consider Maven first, as I believe it to be the most simple of the two.

    Edit:
    IntelliJ has good implementation of both of these, so I would totally go with either of the two rather than IntelliJ's default builder! ;)

    Edit 2:
    Since you're trying to use NMS code (not recommended) you need to use the "spigot" dependency. The cool thing about BuildTools is it automatically installs the artifacts needed into your local Maven repository! That is the only "legal" way of obtaining the "spigot" dependency through Maven.
     
  9. I might try that but I'm still looking for a solution if that should not work.
     
  10. I am using the spigot jar for sure. It worked in previous versions and every other nms code part compiles fine for me.
     
  11. I fixed it by setting the compiler of IntelliJ to eclipse instead of javac. Thats very strange. If anyone has an explanation for that feel free to tell us about it :)
     
  12. What the fuck. Shouldn't happen.
     
  13. Probably because the eclipse compiler sucks less, in my experience. The only advantage intelliJ has is the annoying, usually incorrect pop-up autocomplete and all the integration for advanced features. I cannot really see eclipse working for an enterprise-level project..
     
  14. Afaik the javac compiler is not from IntelliJ. But I have never had any issues with a JetBrains software. I must admit that I'm really happy with IntelliJ and other products from JetBrains after switching from eclipse.
     
    • Agree Agree x 2
  15. It isn't working for me with eclipse compiler. No way to fix it. Anyone else who has the same problem?
     
    • Like Like x 1
  16. It's still easily found on Google and there was no valid solution. I searched for hours to find a solution, so this will be helpful for someone in the future.

    EDIT: The exact same question came around today again: https://www.spigotmc.org/threads/spawn-fake-player-armor-stand.497500 So I think it's totally valid to reply to old topics with the solution. Do you think noone ever uses Google to find forum posts?
     
    • Agree Agree x 1