Solved [ProtocolLib] Player Count Message error!

Discussion in 'Plugin Development' started by mrgreen33gamer, Dec 21, 2014.

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

    mrgreen33gamer

    Hello there!

    I am having a HUGE issue. I am trying to set the player count message using the Protocol Library. Sadly, I get a error message in the console, saying, what I think is, that the PacketListener isn't being loaded/found.

    Here is the error message:
    Code:
    [22:00:36 ERROR]: Could not load 'plugins\GFKits.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/co
    mphenix/protocol/events/PacketListener
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:131) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:328) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:251) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugins(CraftServer.ja
    va:364) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.<init>(CraftServer.java:32
    6) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.PlayerList.<init>(PlayerList.java:68) [c
    raftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.DedicatedPlayerList.<init>(SourceFile:14
    ) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.DedicatedServer.init(DedicatedServer.jav
    a:133) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :436) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    28) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
    Caused by: java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketL
    istener
            at java.lang.Class.forName0(Native Method) ~[?:1.8.0_25]
            at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_25]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:40) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:127) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            ... 9 more
    Caused by: java.lang.ClassNotFoundException: com.comphenix.protocol.events.Packe
    tListener
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_25]
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_25]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_
    25]
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_25]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:77) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_25]
            at java.lang.Class.forName0(Native Method) ~[?:1.8.0_25]
            at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_25]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:40) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:127) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            ... 9 more
    
    Here is my code I am using in my onEnable():
    Code:java
    1.  
    2. private void handlePing(WrappedServerPing ping) {
    3. ping.setPlayers(Arrays.asList(
    4. new WrappedGameProfile("id1", ChatColor.RED + "Hello. " + ChatColor.RESET +
    5. "This is line number one."),
    6. new WrappedGameProfile("id2", "Hello. This is line number two."),
    7. new WrappedGameProfile("id3", "Hello. This is line number three.")
    8. ));
    9. }
    10.  
    11. @Override
    12. public void onEnable() {
    13.  
    14. ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL,
    15. Arrays.asList(PacketType.Status.Server.OUT_SERVER_INFO), ListenerOptions.ASYNC) {
    16.  
    17. @Override
    18. public void onPacketSending(PacketEvent event) {
    19. handlePing(event.getPacket().getServerPings().read(0));
    20. }
    21. });
    22. }
    23.  


    Any idea how I can fix this?!

    Thanks in advanced!

    ~mrgreen33gamer
     
  2. Offline

    mythbusterma

    @mrgreen33gamer

    Why in the world are you trying to manipulate that value? That is incredibly dishonest and is not something you're going to find help with here.
     
  3. Offline

    mrgreen33gamer

  4. Offline

    mythbusterma

  5. Offline

    mrgreen33gamer

    @mythbusterma I am trying to get help from this that that I saw from here:

     
  6. Offline

    mythbusterma

    @mrgreen33gamer

    Add ProtocolLib to your server and make sure to add it to your plugin.yml. And for the love of god, stop watching BCBlowz.
     
  7. Offline

    mrgreen33gamer

    @mythbusterma This is the first video I watched of him... Can't assume someone's life :D! Anyway, I added the dependence to the plugin.yml and I had to fix a few more things.

    Thanks for being here for me @mythbusterma !

    Solved!
     
Thread Status:
Not open for further replies.

Share This Page