diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java index fa358061e..f46a66adb 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java @@ -824,6 +824,7 @@ public class Config .set(false) .comment("" + "Should Distant Horizons silently, automatically download and install new versions? \n" + + "This setting is force disabled on dedicated servers for stability reasons. \n" + "") .build(); diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/GitlabGetter.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/GitlabGetter.java index e35396cee..81430d6d3 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/GitlabGetter.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/installer/GitlabGetter.java @@ -117,7 +117,9 @@ public class GitlabGetter for (Config cfg : currentPipelineInfo) { if (!cfg.get("stage").equals("build")) + { continue; + } downloads.put( ((String) cfg.get("name")).split("\\[|\\]")[1], // Regex to extract the Minecraft version from the text new URL(this.GitProjID + "jobs/" + cfg.get("id") + "/artifacts") @@ -145,7 +147,7 @@ public class GitlabGetter public static URL getLatestForVersion(String mcVer) { try { - return new URL("https://gitlab.com/jeseibel/distant-horizons/-/jobs/artifacts/main/download?job=build:%20[" + mcVer + "]"); + return new URL("https://gitlab.com/distant-horizons-team/distant-horizons/-/jobs/artifacts/main/download?job=build:%20%5B" + mcVer + "%5D"); } catch (Exception e) { e.printStackTrace(); return null; } // This should always be safe (unless you stuff up **badly** somewhere) } } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/jar/updater/SelfUpdater.java b/core/src/main/java/com/seibel/distanthorizons/core/jar/updater/SelfUpdater.java index 90c826fba..748181e2e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/jar/updater/SelfUpdater.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/jar/updater/SelfUpdater.java @@ -129,14 +129,20 @@ public class SelfUpdater // Auto-update mod updateMod(mcVersion, newFileLocation); return false; - } // else + } + else + { + LOGGER.info("Download link: " + ModrinthGetter.getLatestDownloadForVersion(mcVersion)); + } return true; } public static boolean onNightlyStart() { if (GitlabGetter.INSTANCE.projectPipelines.size() == 0) + { return false; + } com.electronwill.nightconfig.core.Config pipeline = GitlabGetter.INSTANCE.projectPipelines.get(0); if (!pipeline.get("ref").equals(ModJarInfo.Git_Branch)) @@ -160,7 +166,9 @@ public class SelfUpdater String latestCommit = pipeline.get("sha"); if (ModJarInfo.Git_Commit.equals(latestCommit)) // If we are already on the latest commit, then dont update + { return false; + } LOGGER.info("New version (" + latestCommit + ") of " + ModInfo.READABLE_NAME + " is available"); @@ -171,6 +179,10 @@ public class SelfUpdater updateMod(mcVersion, newFileLocation); return false; } + else + { + LOGGER.info("Download link: " + GitlabGetter.getLatestForVersion(mcVersion)); + } return true; } @@ -244,7 +256,9 @@ public class SelfUpdater public static boolean updateNightlyMod(String minecraftVersion, File file) { if (GitlabGetter.INSTANCE.projectPipelines.size() == 0) + { return false; + } try {