package mapped;

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

@ObfuscatedName("ib")
public class class214 {
   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "Lea;"
   )
   public UrlRequest field2303;
   @ObfuscatedName("ah")
   public float[] field2300;
   // $FF: synthetic field
   @ObfuscatedSignature(
      descriptor = "Lic;"
   )
   final class208 this$0;

   @ObfuscatedSignature(
      descriptor = "(Lic;)V"
   )
   class214(class208 var1) {
      this.this$0 = var1;
      this.field2300 = new float[4];
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(II)Lhv;",
      garbageValue = "-1391716385"
   )
   public static ItemComposition method4226(int var0) {
      ItemComposition var1 = (ItemComposition)ItemComposition.ItemDefinition_cached.get((long)var0);
      if(var1 != null) {
         return var1;
      } else {
         byte[] var2 = DbRowType.ItemDefinition_archive.takeFile_base(10, var0);
         var1 = new ItemComposition();
         var1.id = var0;
         if(var2 != null) {
            var1.method3950(new Buffer(var2));
         }

         var1.post_base();
         if(var1.noteTemplate != -1) {
            var1.method4011(method4226(var1.noteTemplate), method4226(var1.note));
         }

         if(var1.notedId != -1) {
            var1.method3953(method4226(var1.notedId), method4226(var1.unnotedId));
         }

         if(var1.placeholderTemplate != -1) {
            var1.method3997(method4226(var1.placeholderTemplate), method4226(var1.placeholder));
         }

         if(!class129.ItemDefinition_inMembersWorld && var1.isMembersOnly) {
            if(var1.noteTemplate == -1 && var1.notedId == -1 && var1.placeholderTemplate == -1) {
               var1.name = var1.name + " (Members)";
            }

            var1.isTradable = false;

            int var3;
            for(var3 = 0; var3 < var1.groundActions.length; ++var3) {
               var1.groundActions[var3] = null;
            }

            for(var3 = 0; var3 < var1.inventoryActions.length; ++var3) {
               if(var3 != 4) {
                  var1.inventoryActions[var3] = null;
               }
            }

            var1.shiftClickIndex = -2;
            var1.team = 0;
            if(var1.params != null) {
               boolean var6 = false;

               for(Node var4 = var1.params.method8955(); var4 != null; var4 = var1.params.method8951()) {
                  ParamComposition var5 = Frames.method5518((int)var4.key);
                  if(var5.autoDisable) {
                     var4.remove_base();
                  } else {
                     var6 = true;
                  }
               }

               if(!var6) {
                  var1.params = null;
               }
            }
         }

         ItemComposition.ItemDefinition_cached.put(var1, (long)var0);
         return var1;
      }
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(II)I",
      garbageValue = "-2138855763"
   )
   public static int method4227_base(int var0) {
      return class314.field3402[var0];
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(I)Lrq;",
      garbageValue = "1839119171"
   )
   public static class461 method4228_base() {
      class461[] var0 = class461.field4764;
      class461 var10000;
      synchronized(class461.field4764) {
         if(IgnoreList.field4663 == 0) {
            var10000 = new class461();
            return var10000;
         }

         class461.field4764[--IgnoreList.field4663].method8409_base();
         var10000 = class461.field4764[IgnoreList.field4663];
      }

      return var10000;
   }
}
