Failed to handle packet?

Discussion in 'Plugin Development' started by Kamisoyokaze, Sep 24, 2011.

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

    Kamisoyokaze

    Code:
    [WARNING] Failed to handle packet: java.lang.NullPointerException
    java.lang.NullPointerException
        at net.minecraft.server.ItemStack.a(ItemStack.java:213)
        at net.minecraft.server.InventoryPlayer.h(InventoryPlayer.java:120)
        at net.minecraft.server.EntityHuman.s(EntityHuman.java:299)
        at net.minecraft.server.EntityLiving.s_(EntityLiving.java:280)
        at net.minecraft.server.EntityHuman.s_(EntityHuman.java:153)
        at net.minecraft.server.EntityPlayer.b(EntityPlayer.java:213)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:305)
        at net.minecraft.server.Packet10Flying.a(SourceFile:126)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:464)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    What does this mean (failed to handle packet) and how do i go about fixing it? It also disconnects the player involved and gives them an internal server error.
     
  2. Looks like a CraftBukkit problem. Are you using the latest RB?
     
  3. Offline

    Kamisoyokaze

    yes i am, the 1.8.1 one
     
  4. Are you calling any of the CraftBukkit functions on your own? If not, report this to the Bukkit team.
     
  5. Offline

    Kamisoyokaze

    well it's either this:
    Code:
            public void giveItem(Player player) {
            ItemStack itemstack = new ItemStack(giveId);
            itemstack.setAmount(giveAmount);
            player.getInventory().addItem(itemstack);
            Bukkit.getServer().broadcastMessage("giveItem(Player player) executed");
    
            }
    or this:
    Code:
            public void getItems(Player target) {
                try{
                    String full = "";
    
                    FileInputStream fstream = new FileInputStream(new File("targets.txt"));
                    DataInputStream in = new DataInputStream(fstream);
                    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    
                    FileOutputStream out = new FileOutputStream(new File("targets.txt"));
    
                    String strLine;
    
                    while ((strLine = br.readLine()) != null)   {
    
                      String[] data = strLine.split(" ");
    
                      if(data[0].equals(target))
                      {
                          giveItem = data[2];
                          giveAmount = Integer.parseInt(data[3]);
                          giveItem();
    
                          Bukkit.getServer().broadcastMessage("getItems(Player target) executed");
                      }
                      strLine = data[0]+" "+data[1]+" "+data[2]+" "+data[3];
    
                      full += strLine+"\n";
                    }
    
                    in.close();
    
                    out.write(full.getBytes());
                    out.flush();
                    out.close();
    
                    }catch (Exception e){
                      System.err.println("Error: " + e.getMessage());
                    }
    
            }
    that is messing up. ( yes im using .txt files, this was a plugin i made back in 1.2 that i never finished :p i wasn't good with databases then)

    Oh and if you still think its a bukkit bug how do i report them?

    so do people think it's a bug?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  6. Offline

    pyraetos

    I was having the same problem as I'm trying to bring up to date my inventory modding plugin... On player respawn when it loads an invetory to give the player it disconnects them with "Internal server error" and this
    Code:
    11:22:41 [WARNING] Failed to handle packet: java.lang.NullPointerException
    java.lang.NullPointerException
            at net.minecraft.server.EntityPlayer.b(EntityPlayer.java:218)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:305)
            at net.minecraft.server.Packet10Flying.a(SourceFile:126)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:464)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
     
  7. Offline

    sddddgjd

    Yes,it is a bug! It happens when you try to modify the same item really fast!
    Right now,the only fix that worked for me was to add a delay between item modifying,to prevent spam=crash!
     
  8. Offline

    Perkun

    how to do it?
     
  9. Offline

    fireblast709

    Perkun don't necropost, just create a new thread :3
     
Thread Status:
Not open for further replies.

Share This Page