Solved CRAFTBUKKIT Maven

Discussion in 'Plugin Development' started by negative_codezZ, Nov 17, 2013.

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

    negative_codezZ

    Hey guys,

    I want to add CraftBukkit to my Maven project for using projects. I have been trying and I haven't figured it out. Anyone have any idea?
     
  2. Offline

    TeeePeee

    First you add 'dem repo

    Code:
    <repositories>
          <repository>
          <id>bukkit-repo</id>
          <url>http://repo.bukkit.org/content/groups/public/</url>
        </repository>
    </repositories>
    'Den you add 'dem depends
    Code:
    <dependencies>
        <dependency>
          <groupId>org.bukkit</groupId>
          <artifactId>bukkit</artifactId>
          <version>LATEST</version>
        </dependency>
        <dependency>
          <groupId>org.bukkit</groupId>
          <artifactId>craftbukkit</artifactId>
          <version>LATEST</version>
        </dependency>
    </dependencies>
     
    Zen3515 and thepaperboy99 like this.
  3. Offline

    xTrollxDudex

  4. Offline

    negative_codezZ

    Says cannot find dependency:

    [​IMG]
     
  5. Offline

    1Rogue

    replace the "VERSION" with the version you want
     
  6. Offline

    negative_codezZ

    Thing is, it works with Bukkit. It's the ArtifactID not found.
     
  7. Offline

    1Rogue

    Have you downloaded declared dependancies yet (clean+build would do this)
     
  8. Offline

    negative_codezZ

    It now works:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
     
        <groupId>GGKits</groupId>
        <artifactId>GGKits</artifactId>
        <version>1.0-SNAPSHOT</version>
     
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <bukkitVersion>1.6.4-R2.0</bukkitVersion>
        </properties>
     
        <repositories>
            <repository>
                <id>bukkit-repo</id>
                <url>http://repo.bukkit.org/content/groups/public</url>
            </repository>
        </repositories>
     
        <dependencies>
            <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>bukkit</artifactId>
                <version>LATEST</version>
            </dependency>
            <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>craftbukkit</artifactId>
                <version>LATEST</version>
            </dependency>
        </dependencies>
       
    </project>
    Now that works but when I do something like p.getHandle() (packets) it doesn't work.
     
    Zen3515 likes this.
  9. Offline

    1Rogue

    Assuming p == Player, I would say that's because player has no such method.
     
  10. Offline

    negative_codezZ

    Um... I just did onCommand. Player p = (Player) sender; Then, tried p.getHandle() and there is no such method for the Player.
     
  11. Offline

    1Rogue

  12. Offline

    negative_codezZ

    So, how would I send the packets?

    NVM. Figured out how:

    This is onPlayerDeath:

    Code:java
    1. if(e.getEntity() instanceof Player) {
    2. Packet9Respawn packet = new Packet9Respawn();
    3. packet.a = 1;
    4.  
    5. ((CraftPlayer)e.getEntity()).getHandle().playerConnection.sendPacket(packet);
    6. }


    But, on death I get disconnected with "End of Stream". Console message:

    Code:
    11:25:00 [INFO] negative_codezZ fell from a high place
    11:25:00 [INFO] negative_codezZ lost connection: disconnect.genericReason
    The server does not crash and when I rejoin, it shows me the death screen.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
Thread Status:
Not open for further replies.

Share This Page