Misc fixes
This commit is contained in:
parent
e445547337
commit
1431eb0719
|
@ -19,8 +19,8 @@ public class PathUtil {
|
|||
fileName = fileName.endsWith(EXT_IMOD_DISABLED)
|
||||
? fileName.substring(0, fileName.length() - EXT_IMOD_DISABLED.length())
|
||||
: fileName.endsWith(EXT_IMOD_DISABLED2)
|
||||
? fileName.substring(0, fileName.length() - EXT_IMOD_DISABLED2.length())
|
||||
: fileName.substring(0, fileName.length() - EXT_IMOD.length());
|
||||
? fileName.substring(0, fileName.length() - EXT_IMOD_DISABLED2.length())
|
||||
: fileName.substring(0, fileName.length() - EXT_IMOD.length());
|
||||
return p.getParent().resolve(fileName);
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class PathUtil {
|
|||
public static Path enable(Path p) {
|
||||
String fileName = fn(p);
|
||||
fileName = fileName.endsWith(EXT_IMOD_DISABLED2)
|
||||
? fileName.substring(0, fileName.length() - EXT_IMOD_DISABLED2.length())
|
||||
? fileName.substring(0, fileName.length() - EXT_IMOD_DISABLED2.length()) + EXT_IMOD
|
||||
: fileName.substring(0, fileName.length() - EXT_DISABLED.length());
|
||||
return p.getParent().resolve(fileName);
|
||||
}
|
||||
|
|
|
@ -98,7 +98,8 @@ class ModsDirScannerImpl implements ModsDirScanner {
|
|||
}
|
||||
|
||||
public boolean hasScanned(Path path) {
|
||||
return scannedPaths.contains(path);
|
||||
return scannedPaths.contains(path)
|
||||
|| scannedPaths.contains(path.getParent().resolve(path.getFileName().toString() + ".imod"));
|
||||
}
|
||||
|
||||
private void scanTaskInternal() {
|
||||
|
|
|
@ -12,7 +12,7 @@ public class NamedThreadFactory implements ThreadFactory {
|
|||
|
||||
public NamedThreadFactory(String name) {
|
||||
this.group = Thread.currentThread().getThreadGroup();
|
||||
this.namePrefix = name + "-pool-" + poolNumber.getAndIncrement() + "-thread-";
|
||||
this.namePrefix = name + "-" + poolNumber.getAndIncrement() + "-";
|
||||
}
|
||||
|
||||
public Thread newThread(Runnable r) {
|
||||
|
|
|
@ -152,7 +152,7 @@ public class HttpUtils {
|
|||
}
|
||||
}
|
||||
// CurseForge serverside error
|
||||
if (CURSEFORGE_API.matcher(url).matches() && res.statusCode() == 504) {
|
||||
if (CURSEFORGE_API.matcher(url).matches() && res.statusCode() >= 500 && res.statusCode() < 600) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
|
|
Loading…
Reference in New Issue