@Override
  public void a(PacketDataSerializer packetdataserializer)
      throws IOException { // CraftBukkit - added throws
    a = packetdataserializer.a();
    UUID uuid = UUID.fromString(packetdataserializer.c(36));

    b = new GameProfile(uuid, packetdataserializer.c(16));
    int i = packetdataserializer.a();

    for (int j = 0; j < i; ++j) {
      String s = packetdataserializer.c(32767);
      String s1 = packetdataserializer.c(32767);
      String s2 = packetdataserializer.c(32767);

      b.getProperties().put(s, new Property(s, s1, s2));
    }

    c = packetdataserializer.readInt();
    d = packetdataserializer.readInt();
    e = packetdataserializer.readInt();
    f = packetdataserializer.readByte();
    g = packetdataserializer.readByte();
    h = packetdataserializer.readShort();
    j = DataWatcher.b(packetdataserializer);
  }
Ejemplo n.º 2
0
  @Override
  public void b(PacketDataSerializer var1) throws IOException {
    var1.a(b);

    for (int var2 = 0; var2 < 4; ++var2) {
      var1.a(c[var2]);
    }
  }
  @Override
  public void b(PacketDataSerializer packetdataserializer)
      throws IOException { // CraftBukkit - added throws
    packetdataserializer.b(a);

    UUID uuid = b.getId();
    // Spigot start - protocol patch
    if (packetdataserializer.version < 20) {
      packetdataserializer.a(
          uuid == null
              ? ""
              : packetdataserializer.version >= 5
                  ? uuid.toString()
                  : uuid.toString().replaceAll("-", "")); // Spigot
      packetdataserializer.a(
          b.getName().length() > 16
              ? b.getName().substring(0, 16)
              : b.getName()); // CraftBukkit - Limit name length to 16 characters
      if (packetdataserializer.version >= 5) { // Spigot
        packetdataserializer.b(b.getProperties().size());
        Iterator iterator = b.getProperties().values().iterator();

        while (iterator.hasNext()) {
          Property property = (Property) iterator.next();

          packetdataserializer.a(property.getName());
          packetdataserializer.a(property.getValue());
          packetdataserializer.a(property.getSignature());
        }
      }
    } else {
      packetdataserializer.writeUUID(uuid);
    }
    // Spigot end

    packetdataserializer.writeInt(c);
    packetdataserializer.writeInt(d);
    packetdataserializer.writeInt(e);
    packetdataserializer.writeByte(f);
    packetdataserializer.writeByte(g);
    // Spigot start - protocol patch
    if (packetdataserializer.version >= 47) {
      packetdataserializer.writeShort(org.spigotmc.SpigotDebreakifier.getItemId(h));
    } else {
      packetdataserializer.writeShort(h);
    }
    i.a(packetdataserializer);
  }
 public void b(PacketDataSerializer var1) throws IOException {
   var1.a(this.a);
   var1.a((Enum) this.b);
 }
 public void a(PacketDataSerializer var1) throws IOException {
   this.a = var1.c(40);
   this.b =
       (PacketPlayInResourcePackStatus.EnumResourcePackStatus)
           var1.a(PacketPlayInResourcePackStatus.EnumResourcePackStatus.class);
 }
 public void b(PacketDataSerializer packetdataserializer) throws IOException {
   packetdataserializer.b(this.a);
   packetdataserializer.a(this.b);
 }
 public void a(PacketDataSerializer var1) throws IOException {
   this.a =
       (PacketPlayInClientCommand.EnumClientCommand)
           var1.a(PacketPlayInClientCommand.EnumClientCommand.class);
 }
 public void b(PacketDataSerializer packetdataserializer) {
   packetdataserializer.a(a.toJson(this.b));
 }