1.8.8 How to compress packet

Discussion in 'Spigot Plugin Development' started by Paisley4, Mar 11, 2020.

Thread Status:
Not open for further replies.
  1. I need to compress "PacketLoginOutEncryptionBegin" because the number of bytes from the PublicKey is too large and I can't send it to the player (there are over 150 bytes). Below is the code to send the package. Version: v1_8_R3

    Code (Java):
    public static void send(Player player){
            MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
            byte[] data = new byte[0];
            new Random().nextBytes(data);
            PacketLoginOutEncryptionBegin packet = new PacketLoginOutEncryptionBegin(server.E(), server.Q().getPublic(), data);
            ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
    #1 Paisley4, Mar 11, 2020
    Last edited: Mar 20, 2020
Thread Status:
Not open for further replies.