mojira.dev
MC-33355

Availlable Resource Packs seems unorganised

Description:

When choosing resource packs, it's a bit long to read each resources pack to find the one we want, in a alphabetical order, it would be easier.

Justification:

It's a bug and not a sugestion not because it's to add a functionnaility but because it's incoherent, simply because java.io.File.listFiles is incoherent by it's order.

Actual:

Available Resource Packs list is unorganised.

Expected:

Having Available Resource Packs list alphabeticaly ordered.

Solution:

GuiScreenTemporaryResourcePackSelectSelectionList.java

package net.minecraft.src;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;

public class ResourcePackRepository
{
	public void updateRepositoryEntriesAll() {
		ArrayList var1 = Lists.newArrayList();
		Iterator var2 = this.getResourcePackFiles().iterator();
		while (var2.hasNext()) {
			File var3 = (File)var2.next();
			ResourcePackRepositoryEntry var4 = new ResourcePackRepositoryEntry(this, var3, (ResourcePackRepositoryFilter)null);
			if (!this.repositoryEntriesAll.contains(var4)) {
				try {
					var4.updateResourcePack();
					var1.add(var4);
				} catch (Exception var6) {
					var1.remove(var4);
				}
			} else {
				var1.add(this.repositoryEntriesAll.get(this.repositoryEntriesAll.indexOf(var4)));
			}
		}
		this.repositoryEntriesAll.removeAll(var1);
		var2 = this.repositoryEntriesAll.iterator();
		while (var2.hasNext()){
			ResourcePackRepositoryEntry var7 = (ResourcePackRepositoryEntry)var2.next();
			var7.closeResourcePack();
		}
		/* START OF NEW CODE */
		Collections.sort(var1, new Comparator<ResourcePackRepositoryEntry>(){
			public int compare(ResourcePackRepositoryEntry a, ResourcePackRepositoryEntry b) {
      				return a.getResourcePackName().compareTo(b.getResourcePackName());
			}
		});
		/* END OF NEW CODE */
		this.repositoryEntriesAll = var1;
	}
}

Attachments

Comments 2

This site is for bug reports only. For feature suggestions or changes please use the Minecraft Forums: Suggestions.

It's a bug and not a sugestion not because it's to add a functionnaility but because it's incoherent, simply because java.io.File.listFiles is incoherent by it's order.

I've posted a workaround to fix that.

Yoann Petremann

(Unassigned)

Unconfirmed

interface, resource-pack

Minecraft 13w39b

Retrieved