[Packet][13w39] Send OpenInventory Statistic

Discussion in 'Spigot Help' started by Fejm, Oct 3, 2013.

  1. Hi!

    I used this path: https://github.com/SpigotMC/Spigot/commit/c04d3c5f80eb932461c5a70c08949a98eb926ee9 to mod spigot to "create 1.7 with plugins server".

    I implement new block, items etc.. 7 days of work.. I know - this is crazy.. But.. Idea is great.

    My problem is Achievement "Press E to open inventory".. I tryied everything, spigot modding, plugin (with ProtocolLib) etc... It's not disappearing.. Client just ignoring this packet..

    I know about 13w39b has different packet statistic! I added string filed to Packet200Statistic.java and i can send packet like in 13w39b: http://wiki.vg/Pre-release_protocol

    So.. With ProtocolLib:
    Code (Text):

    if (cmd.getName().equalsIgnoreCase("send-packet")) {            
                 
                    Player player = sender.getServer().getPlayer(sender.getName());
                 
                    PacketContainer fakeStat = protocolManager.createPacket(200);
                     
                        fakeStat.getIntegers().
                            write(0, 1).
                            write(1, 5242880);
                         
                        fakeStat.getStrings().
                            write(0, "openInventory");                            
     
                 
                    try {
                        player.sendMessage(ChatColor.GREEN+"[SUKCES] Sending fake packet");                
                        protocolManager.sendServerPacket(player, fakeStat);
                    } catch (InvocationTargetException e) {
                        player.sendMessage(ChatColor.RED+"[ERROR] Sending fake packet");
                        e.printStackTrace();
                    }
                 
                    return true;
    Can anyone tell me what i doing wrong with this packet?

    IP of server running this stuff: snapshot.easycraft.pl

    P.s.
    Sorry for my english :)
     
    #1 Fejm, Oct 3, 2013
    Last edited: Oct 3, 2013
    • Disagree Disagree x 1
  2. joehot200

    Supporter

    Lel i saw your advertisment on PMC.

    I have got NO idea how to fix that lol.
     
  3. Yup, but still no players :X
    What is your nickname?
     
    • Disagree Disagree x 1
  4. joehot200

    Supporter

    its always joehot200. I was busy doing some coding and so did not have the time to join.
     
  5. And what progress?
     
  6. Progress of coding :)
     
    • Disagree Disagree x 1
  7. joehot200

    Supporter

    I was perfecting spleef (done), fixing a error where players cant teleport (not done yet) and also messing around with some lwjgl code.
    ScreenHunter_42 Oct. 03 23.41.png
     
  8. md_5

    Administrator Developer

    As far as I know ProtocolLib won't work because it doesn't know whether to send the string or the int first. You should bring this up with the developer, or try moving the second int sending code after the string.
     
  9. So.. If protocollib can't do this..

    Code (Text):
                    for (Field field : packet.getClass().getDeclaredFields())
                    {
                        try
                        {
                            field.setAccessible(true);
                            String fieldName = field.getName();
                            switch (fieldName)
                            {
                                case "a":
                                    field.setInt(packet, 1);
                                    break;
                                case "b":
                                    field.setInt(packet, 5242880);
                                    break;
                                case "c":
                                    field.set(packet, "openInventory");
                                    break;
                            }
                        }
                        catch (Exception e)
                        {
                            System.out.println(e.getMessage());
                            return false;
                        }
                    }
    this also not working but client receives a packet.. I know about this because i have packet listener [protlib] which one give me this:
    [​IMG]
     
  10. Ok, i used jd-gui to decompile source and i try to find "0x50000" (statistic offset).. But.. It does not exist..

    So, offset must be different but i can't find "new offset" :X
     
    • Disagree Disagree x 1