package mapped;

import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;

@ObfuscatedName("si")
public class class472 {
   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "Lsi;"
   )
   public static final class472 field4810;
   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "Lsi;"
   )
   static final class472 field4811;
   @ObfuscatedName("ar")
   String field4809;

   static {
      field4810 = new class472("application/json");
      field4811 = new class472("text/plain");
   }

   class472(String var1) {
      this.field4809 = var1;
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(I)Ljava/lang/String;",
      garbageValue = "1925429052"
   )
   public String method8563_base() {
      return this.field4809;
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(II)Ltu;",
      garbageValue = "-1027788130"
   )
   public static class514 method8562_base(int var0) {
      int var1 = class512.field5056[var0];
      return var1 == 1?class514.field5065:(var1 == 2?class514.field5061:(var1 == 3?class514.field5066:null));
   }

   @ObfuscatedName("aa")
   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "-1965157377"
   )
   public static void method8564_base() {
      class316.field3424.clear();
   }

   @ObfuscatedName("kn")
   @ObfuscatedSignature(
      descriptor = "(Luo;B)V",
      garbageValue = "-41"
   )
   static final void method8567(PacketBuffer var0) {
      var0.importIndex_base();
      int var1 = var0.readBits_base(8);
      int var2;
      if(var1 < Client.npcCount) {
         for(var2 = var1; var2 < Client.npcCount; ++var2) {
            Client.field618[++Client.field617 - 1] = Client.npcIndices[var2];
         }
      }

      if(var1 > Client.npcCount) {
         throw new RuntimeException("");
      } else {
         Client.npcCount = 0;

         for(var2 = 0; var2 < var1; ++var2) {
            int var3 = Client.npcIndices[var2];
            NPC var4 = Client.npcs[var3];
            int var5 = var0.readBits_base(1);
            if(var5 == 0) {
               Client.npcIndices[++Client.npcCount - 1] = var3;
               var4.npcCycle = Client.cycle;
            } else {
               int var6 = var0.readBits_base(2);
               if(var6 == 0) {
                  Client.npcIndices[++Client.npcCount - 1] = var3;
                  var4.npcCycle = Client.cycle;
                  Client.field549[++Client.field637 - 1] = var3;
               } else {
                  int var7;
                  int var8;
                  if(var6 == 1) {
                     Client.npcIndices[++Client.npcCount - 1] = var3;
                     var4.npcCycle = Client.cycle;
                     var7 = var0.readBits_base(3);
                     var4.method2664_base(var7, class228.field2409);
                     var8 = var0.readBits_base(1);
                     if(var8 == 1) {
                        Client.field549[++Client.field637 - 1] = var3;
                     }
                  } else if(var6 == 2) {
                     Client.npcIndices[++Client.npcCount - 1] = var3;
                     var4.npcCycle = Client.cycle;
                     if(var0.readBits_base(1) == 1) {
                        var7 = var0.readBits_base(3);
                        var4.method2664_base(var7, class228.field2410);
                        var8 = var0.readBits_base(3);
                        var4.method2664_base(var8, class228.field2410);
                     } else {
                        var7 = var0.readBits_base(3);
                        var4.method2664_base(var7, class228.field2408);
                     }

                     var7 = var0.readBits_base(1);
                     if(var7 == 1) {
                        Client.field549[++Client.field637 - 1] = var3;
                     }
                  } else if(var6 == 3) {
                     Client.field618[++Client.field617 - 1] = var3;
                  }
               }
            }
         }

      }
   }
}
