fix: installer trying to download & install libraries it shouldnt
This commit is contained in:
parent
d959985ffc
commit
ab9040d2a4
3 changed files with 34 additions and 27 deletions
2
.vscode/snippets/java.json
vendored
2
.vscode/snippets/java.json
vendored
|
@ -2,7 +2,7 @@
|
|||
"LogManager_Log": {
|
||||
"prefix": "logmanager",
|
||||
"body": [
|
||||
"LogManager.${1|debug,warn,logStackTrace,info,error|}(${2:\"Test\"});"
|
||||
"LogManager.${1|debug,debugObject,warn,logStackTrace,info,error|}(${2:\"Test\"});"
|
||||
],
|
||||
"description": "Log a debug message to the ATLauncher console"
|
||||
}
|
||||
|
|
|
@ -53,6 +53,10 @@ public final class LogManager {
|
|||
debug(message, false);
|
||||
}
|
||||
|
||||
public static void debugObject(Object object) {
|
||||
debug(Gsons.DEFAULT.toJson(object), false);
|
||||
}
|
||||
|
||||
public static void debug(String message, boolean force) {
|
||||
if (showDebug || force) {
|
||||
queue.offer(new LogEvent(LogType.DEBUG, message));
|
||||
|
|
|
@ -627,7 +627,8 @@ public class NewInstanceInstaller extends InstanceInstaller {
|
|||
}
|
||||
|
||||
private List<Downloadable> getDownloadableLibraries() {
|
||||
return this.getLibraries().stream().map(library -> {
|
||||
return this.getLibraries().stream()
|
||||
.filter(library -> library.shouldInstall() && library.downloads.artifact != null).map(library -> {
|
||||
if (library instanceof ForgeLibrary && ((ForgeLibrary) library).isUsingPackXz()) {
|
||||
return new ForgeXzDownloadable(library.downloads.artifact.url,
|
||||
new File(App.settings.getGameLibrariesDir(), library.downloads.artifact.path),
|
||||
|
@ -654,7 +655,8 @@ public class NewInstanceInstaller extends InstanceInstaller {
|
|||
fireTask(Language.INSTANCE.localize("instance.organisinglibraries"));
|
||||
fireSubProgressUnknown();
|
||||
|
||||
this.getLibraries().stream().forEach(library -> {
|
||||
this.getLibraries().stream().filter(library -> library.shouldInstall() && library.downloads.artifact != null)
|
||||
.forEach(library -> {
|
||||
File libraryFile = new File(App.settings.getGameLibrariesDir(), library.downloads.artifact.path);
|
||||
|
||||
if (isServer) {
|
||||
|
@ -664,7 +666,8 @@ public class NewInstanceInstaller extends InstanceInstaller {
|
|||
|
||||
Utils.copyFile(libraryFile, serverFile, true);
|
||||
} else if (library.hasNativeForOS()) {
|
||||
File nativeFile = new File(App.settings.getGameLibrariesDir(), library.getNativeDownloadForOS().path);
|
||||
File nativeFile = new File(App.settings.getGameLibrariesDir(),
|
||||
library.getNativeDownloadForOS().path);
|
||||
|
||||
ZipUtil.unpack(nativeFile, this.getNativesDirectory(), new NameMapper() {
|
||||
public String map(String name) {
|
||||
|
|
Loading…
Reference in a new issue