Why can't i use packets?

Discussion in 'Spigot Plugin Development' started by Waterman2707, May 9, 2015.

  1. Hi Spigot

    I have now tried a lot to figured out why i can't use packets. Then i create the code, example with a CraftPlayer it jsut give me a error, but i can't import any CraftPlayer???
    I use maven if it's to any help ;)

    //Water
     
  2. Serializator

    Supporter

    You also need to add the server JAR as a dependency in Maven.
    The API JAR doesn't provide any packet classes or such things.
     
  3. You don't need Maven for it
     
  4. And how do it looks like?
     
  5. Serializator

    Supporter

    He is using Maven, so you add the server JAR as a dependency in your pom.xml.
     
  6. Serializator

    Supporter

    Code (Text):
    // The path in the systemPath is an example.
    <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.8.3-R0.1-SNAPSHOT</version>
            <scope>system</scope>
            <systemPath>D:\Workspace\Libraries\Spigot-Server.jar</systemPath>
    </dependency>
     
  7. Okay then i also need to but the spigot server jar there my path go to right?
     
  8. Serializator

    Supporter

    The path is where your JAR is located, so if you mean you need to put it into "D:\Workspace\Libraries\" the answer is no.
     
  9. Sorry for the simple question, but I really not understand it :( what jar are you meaning and how do I find it location?
     
  10. @Serializator you should use the jar installed in your local repo rather than the system scope.
     
    • Agree Agree x 1
  11. Whilst I agree, usually it's so much easier and quicker to add it to a folder within the project root. Like ${project.basedir}/lib/spigot.jar
     
  12. Upon running BuildTools, the server artifact gets put in your local repo so it's actually easier than specifying a system path.
     
    • Agree Agree x 1
  13. Okay can I so get a step by step guide of this? Because I really not understand what you are meaning :S
     
  14. You said in your first post you use maven. So you probably have a basic understanding on how to use maven or? Then this is the answer you are looking for

     
  15. Ah, well I don't run BT on my local PC, I'd be waiting centuries.
     
  16. You can still install it manually :p.
     
  17. Laziness dictates that I do it via the system scope.
     
    • Like Like x 2