public ResourcePackRepository(
      File p_i45101_1_,
      File p_i45101_2_,
      IResourcePack p_i45101_3_,
      IMetadataSerializer p_i45101_4_,
      GameSettings p_i45101_5_) {
    this.dirResourcepacks = p_i45101_1_;
    this.dirServerResourcepacks = p_i45101_2_;
    this.rprDefaultResourcePack = p_i45101_3_;
    this.rprMetadataSerializer = p_i45101_4_;
    this.fixDirResourcepacks();
    this.updateRepositoryEntriesAll();
    Iterator iterator = p_i45101_5_.resourcePacks.iterator();

    while (iterator.hasNext()) {
      String s = (String) iterator.next();
      Iterator iterator1 = this.repositoryEntriesAll.iterator();

      while (iterator1.hasNext()) {
        ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry) iterator1.next();

        if (entry.getResourcePackName().equals(s)) {
          this.repositoryEntries.add(entry);
          break;
        }
      }
    }
  }
  public void updateRepositoryEntriesAll() {
    ArrayList arraylist = Lists.newArrayList();
    Iterator iterator = this.getResourcePackFiles().iterator();

    while (iterator.hasNext()) {
      File file1 = (File) iterator.next();
      ResourcePackRepository.Entry entry = new ResourcePackRepository.Entry(file1, null);

      if (!this.repositoryEntriesAll.contains(entry)) {
        try {
          entry.updateResourcePack();
          arraylist.add(entry);
        } catch (Exception exception) {
          arraylist.remove(entry);
        }
      } else {
        int i = this.repositoryEntriesAll.indexOf(entry);

        if (i > -1 && i < this.repositoryEntriesAll.size()) {
          arraylist.add(this.repositoryEntriesAll.get(i));
        }
      }
    }

    this.repositoryEntriesAll.removeAll(arraylist);
    iterator = this.repositoryEntriesAll.iterator();

    while (iterator.hasNext()) {
      ResourcePackRepository.Entry entry1 = (ResourcePackRepository.Entry) iterator.next();
      entry1.closeResourcePack();
    }

    this.repositoryEntriesAll = arraylist;
  }