From 0482f666c7b4cac8efed744d031ed0d3c01cfefd Mon Sep 17 00:00:00 2001 From: Osiris Team Date: Thu, 19 Oct 2023 14:12:39 +0200 Subject: [PATCH] 7.3.11 - FIX: .install mod not renaming NEW_MOD to actual name - FIX: .install mod throwing error and causing endless task loop --- pom.xml | 2 +- .../osiris/autoplug/client/console/Commands.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 74cd037d..33433fa3 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.osiris.autoplug.client autoplug-client - 7.3.10 + 7.3.11 jar AutoPlug-Client diff --git a/src/main/java/com/osiris/autoplug/client/console/Commands.java b/src/main/java/com/osiris/autoplug/client/console/Commands.java index 64fb829f..26ddd1e9 100644 --- a/src/main/java/com/osiris/autoplug/client/console/Commands.java +++ b/src/main/java/com/osiris/autoplug/client/console/Commands.java @@ -401,17 +401,17 @@ public static boolean installMod(String command) throws Exception { return false; } MyBThreadManager myManager = new UtilsTasks().createManagerAndPrinter(); - File finalDest = new File(modsDir + "/" + result.plugin.getName() + "-LATEST-[" + result.latestVersion + "].jar"); - TaskModDownload task = new TaskModDownload("PluginDownloader", myManager.manager, tempName, result.latestVersion, - result.downloadUrl, result.plugin.getIgnoreContentType(), "AUTOMATIC", finalDest); + File finalDest = new File(modsDir + "/" + result.mod.getName() + "-LATEST-[" + result.latestVersion + "].jar"); + TaskModDownload task = new TaskModDownload("ModDownloader", myManager.manager, tempName, result.latestVersion, + result.downloadUrl, result.mod.ignoreContentType, "AUTOMATIC", finalDest); task.start(); new UtilsTasks().printResultsWhenDone(myManager.manager); - List plugins = new UtilsMinecraft().getPlugins(modsDir); - for (MinecraftPlugin pl : plugins) { - if (pl.getInstallationPath().equals(finalDest.getAbsolutePath())) { + List plugins = new UtilsMinecraft().getMods(modsDir); + for (MinecraftMod mod : plugins) { + if (mod.installationPath.equals(finalDest.getAbsolutePath())) { // Replace tempName with actual plugin name finalDest = new UtilsFile().renameFile(task.getFinalDest(), - new File(pl.getInstallationPath()).getName().replace(tempName, pl.getName())); + new File(mod.installationPath).getName().replace(tempName, mod.getName())); } } AL.info("Installed to: " + finalDest);