package net.optifine.util; import java.util.ArrayList; import java.util.List; import net.minecraft.client.resources.IResourcePack; public class ResUtils { public static List collectPropertyFiles(IResourcePack rp, String prefix) { List ret = new ArrayList<>(); for (String str : rp.getEaglerFileIndex().getPropertiesFiles()) { if (str.startsWith(prefix)) { ret.add(str); } } return ret; } public static List collectPropertyFiles(IResourcePack rp, String... prefixes) { List ret = new ArrayList<>(); for (String str : rp.getEaglerFileIndex().getPropertiesFiles()) { for (int i = 0; i < prefixes.length; ++i) { if (str.startsWith(prefixes[i])) { ret.add(str); } } } return ret; } public static List collectPotionFiles(IResourcePack rp, String prefix) { List ret = new ArrayList<>(); for (String str : rp.getEaglerFileIndex().getCITPotionsFiles()) { if (str.startsWith(prefix)) { ret.add(str); } } return ret; } public static List collectPotionFiles(IResourcePack rp, String... prefixes) { List ret = new ArrayList<>(); for (String str : rp.getEaglerFileIndex().getCITPotionsFiles()) { for (int i = 0; i < prefixes.length; ++i) { if (str.startsWith(prefixes[i])) { ret.add(str); } } } return ret; } }