Ejemplo n.º 1
0
 private static void func_35311_a(java.util.Random random, StructurePieceTreasure[] astructurepiecetreasure, ContainerChest tileentitychest, int i)
 {
     for (int j = 0; j < i; j++)
     {
         StructurePieceTreasure structurepiecetreasure = (StructurePieceTreasure)WeightedRandom.func_35691_a(random, astructurepiecetreasure);
         int k = structurepiecetreasure.field_35488_c + random.nextInt((structurepiecetreasure.field_35486_e - structurepiecetreasure.field_35488_c) + 1);
         if (Inventory.isStackable((short)structurepiecetreasure.field_35489_a) >= k)
         {
             tileentitychest.SetSlot(random.nextInt(tileentitychest.Size), new Item((short)structurepiecetreasure.field_35489_a, (byte)k, (short)structurepiecetreasure.field_35487_b));
             continue;
         }
         for (int l = 0; l < k; l++)
         {
             tileentitychest.SetSlot(random.nextInt(tileentitychest.Size), new Item((short)structurepiecetreasure.field_35489_a, 1, (short)structurepiecetreasure.field_35487_b));
         }
     }
 }
        private static void func_35311_a(java.util.Random random, StructurePieceTreasure[] astructurepiecetreasure, ContainerChest tileentitychest, int i)
        {
            for(int j = 0; j < i; j++)
            {
                StructurePieceTreasure structurepiecetreasure = (StructurePieceTreasure)WeightedRandom.func_35691_a(random, astructurepiecetreasure);
                int k = structurepiecetreasure.field_35488_c + random.nextInt((structurepiecetreasure.field_35486_e - structurepiecetreasure.field_35488_c) + 1);
                if(Inventory.isStackable((short)structurepiecetreasure.field_35489_a) >= k)
                {
                    tileentitychest.SetSlot(random.nextInt(tileentitychest.Size), new Item((short)structurepiecetreasure.field_35489_a, (byte)k, (short)structurepiecetreasure.field_35487_b));
                    continue;
                }
                for(int l = 0; l < k; l++)
                {
                    tileentitychest.SetSlot(random.nextInt(tileentitychest.Size), new Item((short)structurepiecetreasure.field_35489_a, 1, (short)structurepiecetreasure.field_35487_b));
                }

            }
        }