Need help with Packets/Protocol Lib.

Discussion in 'Spigot Plugin Development' started by Cloaking_Ocean, Jun 26, 2015.

  1. So recently I've wanted to start learning how to use packets and most people would agree to start with Protocol Lib but unfortunately when I started going through the tutorial and created the plugin and tried it on my server none of the features worked. I've seen some threads that say it doesn't work with 1.8 of bukkit and some people used a different jar but it still doesn't work for me.

    I just put the two packetlisteners at the beginning of the tutorial in my on enable and the fake explosion inside a command. http://dev.bukkit.org/bukkit-plugins/protocollib/pages/tutorial/ This is the page I got it from.

    When I put it on my server along with protocolib in the plugins folder it didn't work and the fake explosion game me a null pointer error on the line : "PacketContainer fakeExplosion = protocolManager.createPacket(PacketType.Play.Server.EXPLOSION);"

    If there's a different approach I should take like just not using protocol lib and trying to figure out how to do it with just refraction please tell me. Any help is appreciated and thanks in advance.
     
  2. your protocolManager is null. Either try to figure out why or give us more code.
     
  3. Did you instantiate the protocolManager?
     
  4. Alright I was kind oblivious to not checking to see if it was set to something before I used it but this time when I tried it I got an error message while protocol lib was trying to load

    [19:47:15] [Server thread/INFO]: [ProtocolLib] Loading ProtocolLib v3.4.0
    [19:47:15] [Server thread/WARN]: [ProtocolLib] Version (MC: 1.8.0) has not yet been tested! Proceed with caution.
    [19:47:15] [Server thread/ERROR]: [ProtocolLib] INTERNAL ERROR: Cannot load ProtocolLib.
    If this problem hasn't already been reported, please open a ticket
    at http://dev.bukkit.org/server-mods/protocollib/ with the following data:
    ===== STACK TRACE =====
    java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.build(Lcom/google/common/cache/CacheLoader;)Lcom/google/common/cache/Cache;
    at com.comphenix.protocol.utility.MinecraftReflection.<clinit>(MinecraftReflection.java:155)
    at com.comphenix.protocol.injector.PacketFilterManager.<init>(PacketFilterManager.java:259)
    at com.comphenix.protocol.injector.PacketFilterBuilder.buildInternal(PacketFilterBuilder.java:250)
    at com.comphenix.protocol.injector.PacketFilterBuilder.build(PacketFilterBuilder.java:233)
    at com.comphenix.protocol.ProtocolLibrary.onLoad(ProtocolLibrary.java:216)
    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:295)
    at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:152)
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:494)
    at java.lang.Thread.run(Thread.java:745)
    ===== DUMP =====
    Parameters:
    [NULL]
    Sender:
    [email protected][
    statistisc=<null>
    backgroundCompiler=<null>
    packetTask=-1
    tickCounter=0
    [email protected]8844a
    configExpectedMod=-1
    [email protected]
    [email protected]
    redirectHandler=<null>
    commandProtocol=<null>
    commandPacket=<null>
    commandFilter=<null>
    skipDisable=false
    isEnabled=false
    [email protected]
    server=CraftServer{serverName=CraftBukkit,serverVersion=git-Spigot-c46583f-e6f9fd4,minecraftVersion=1.8}
    file=plugins/ProtocolLib-3.4.0.jar
    [email protected]
    dataFolder=plugins/ProtocolLib
    [email protected]
    naggable=true
    ebean=<null>
    newConfig=YamlConfiguration[path='', root='YamlConfiguration']
    configFile=plugins/ProtocolLib/config.yml
    [email protected]
    ]
    Version:
    ProtocolLib v3.4.0
    Server:
    git-Spigot-c46583f-e6f9fd4 (MC: 1.8)

    I am currently using this version of ProtocolLib http://dev.bukkit.org/bukkit-plugins/protocollib/files/32-protocol-lib-3-4-0/

    Is it possibly because I'm downloading it from bukkit and not spigot?


    EDIT: Yes it appears so. I was using bukkit's version instead of spigots but now that I switched it seems to be working. Sorry for the bother. Thanks for the help @Borlea and @MasterEjay
     
    #4 Cloaking_Ocean, Jun 27, 2015
    Last edited: Jun 27, 2015
    • Funny Funny x 1