Use Forge resource finder for directories instead of MF finder
This commit is contained in:
parent
213bcd1b2a
commit
2663f5e3f4
|
|
@ -92,20 +92,12 @@ public class ModernFixResourceFinder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Enumeration<URL> findAllURLsForResource(String input) {
|
public static Enumeration<URL> findAllURLsForResource(String input) {
|
||||||
// CachedResourcePath normalizes already but we need to strip trailing slash if any
|
// fallback to Forge impl for any paths ending in a slash
|
||||||
// TODO move logic to FileUtil.normalize()
|
char endChar = input.length() > 0 ? input.charAt(input.length() - 1) : '/';
|
||||||
int lastIndex = input.length();
|
if(endChar == '/' || endChar == '\\') {
|
||||||
boolean strip = false;
|
return LoadingModList.get().findAllURLsForResource(input);
|
||||||
while(lastIndex > 1) {
|
|
||||||
char c = input.charAt(lastIndex - 1);
|
|
||||||
if (c == '/' || c == '\\') {
|
|
||||||
lastIndex--;
|
|
||||||
strip = true;
|
|
||||||
} else
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if(strip)
|
// CachedResourcePath normalizes already
|
||||||
input = input.substring(0, lastIndex);
|
|
||||||
Collection<String> urlList = urlsForClass.get(new CachedResourcePath(input));
|
Collection<String> urlList = urlsForClass.get(new CachedResourcePath(input));
|
||||||
if(!urlList.isEmpty()) {
|
if(!urlList.isEmpty()) {
|
||||||
String pathInput = FileUtil.normalize(input);
|
String pathInput = FileUtil.normalize(input);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user