mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-12-14 04:58:46 +01:00
Update #48 - Added some features from OptiFine
This commit is contained in:
54
sources/main/java/net/optifine/util/ResUtils.java
Normal file
54
sources/main/java/net/optifine/util/ResUtils.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package net.optifine.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.resources.IResourcePack;
|
||||
|
||||
public class ResUtils {
|
||||
|
||||
public static List<String> collectPropertyFiles(IResourcePack rp, String prefix) {
|
||||
List<String> ret = new ArrayList<>();
|
||||
for (String str : rp.getEaglerFileIndex().getPropertiesFiles()) {
|
||||
if (str.startsWith(prefix)) {
|
||||
ret.add(str);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static List<String> collectPropertyFiles(IResourcePack rp, String... prefixes) {
|
||||
List<String> 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<String> collectPotionFiles(IResourcePack rp, String prefix) {
|
||||
List<String> ret = new ArrayList<>();
|
||||
for (String str : rp.getEaglerFileIndex().getCITPotionsFiles()) {
|
||||
if (str.startsWith(prefix)) {
|
||||
ret.add(str);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static List<String> collectPotionFiles(IResourcePack rp, String... prefixes) {
|
||||
List<String> 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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user