diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java index 3e601ecd3..228c4a218 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java @@ -245,7 +245,7 @@ public class ClassicConfigGUI } // Changelog button - if (Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get() && Config.Client.Advanced.AutoUpdater.updateBranch.get() == EDhApiUpdateBranch.STABLE) + if (Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get() && !ModInfo.IS_DEV_BUILD) // we only have changelogs for stable builds { this.addBtn(new TexturedButtonWidget( // Where the button is on the screen diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java index 1328a5ba9..76adb6d58 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java @@ -168,10 +168,9 @@ public class ChangelogScreen extends DhScreen #endif - this.changelogArea.render(matrices, mouseX, mouseY, delta); // Render the changelog - + // render order matters, otherwise on 1.20.6+ the blurred background will render on top of the text super.render(matrices, mouseX, mouseY, delta); // Render the buttons - + this.changelogArea.render(matrices, mouseX, mouseY, delta); // Render the changelog DhDrawCenteredString(matrices, font, title, width / 2, 15, 0xFFFFFF); // Render title } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java index 446af8432..01ac2bb2f 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java @@ -41,16 +41,18 @@ public class UpdateModScreen extends DhScreen super(Translatable(ModInfo.ID + ".updater.title")); this.parent = parent; this.newVersionID = newVersionID; - - switch (Config.Client.Advanced.AutoUpdater.updateBranch.get()) { - case STABLE: - currentVer = ModInfo.VERSION; - nextVer = ModrinthGetter.releaseNames.get(this.newVersionID); - break; - case NIGHTLY: - currentVer = ModJarInfo.Git_Commit.substring(0,7); - nextVer = this.newVersionID.substring(0,7); - break; + + + EDhApiUpdateBranch updateBranch = EDhApiUpdateBranch.convertAutoToStableOrNightly(Config.Client.Advanced.AutoUpdater.updateBranch.get()); + if (updateBranch == EDhApiUpdateBranch.STABLE) + { + this.currentVer = ModInfo.VERSION; + this.nextVer = ModrinthGetter.releaseNames.get(this.newVersionID); + } + else + { + this.currentVer = ModJarInfo.Git_Commit.substring(0,7); + this.nextVer = this.newVersionID.substring(0,7); } } @@ -88,7 +90,7 @@ public class UpdateModScreen extends DhScreen e.printStackTrace(); } - if (Config.Client.Advanced.AutoUpdater.updateBranch.get() == EDhApiUpdateBranch.STABLE) + if (!ModInfo.IS_DEV_BUILD) { this.addBtn(new TexturedButtonWidget( // Where the button is on the screen diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinMinecraft.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinMinecraft.java index 761b8b22f..a259a2b11 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinMinecraft.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinMinecraft.java @@ -10,6 +10,7 @@ import com.seibel.distanthorizons.core.jar.installer.GitlabGetter; import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter; import com.seibel.distanthorizons.core.jar.updater.SelfUpdater; import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants; +import com.seibel.distanthorizons.coreapi.ModInfo; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.TitleScreen; @@ -97,13 +98,23 @@ public abstract class MixinMinecraft ) ) { - runnable = () -> { + runnable = () -> + { + String versionId; + EDhApiUpdateBranch updateBranch = EDhApiUpdateBranch.convertAutoToStableOrNightly(Config.Client.Advanced.AutoUpdater.updateBranch.get()); + if (updateBranch == EDhApiUpdateBranch.STABLE) + { + versionId = ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()); + } + else + { + versionId = GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha"); + } + Minecraft.getInstance().setScreen(new UpdateModScreen( // TODO: Change to runnable, instead of tittle screen new TitleScreen(false), // We don't want to use the vanilla title screen as it would fade the buttons - (Config.Client.Advanced.AutoUpdater.updateBranch.get() == EDhApiUpdateBranch.STABLE - ? ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()) - : GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha")) + versionId )); }; } diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 3aa8af35d..db15ae4bf 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -56,7 +56,6 @@ }, "suggests": { - "blendium": "*" }, "breaks": $fabric_incompatibility_list, diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinMinecraft.java b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinMinecraft.java index 9560825dc..4bcedc1ad 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinMinecraft.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinMinecraft.java @@ -73,11 +73,23 @@ public class MixinMinecraft && SelfUpdater.onStart() ) { - runnable = () -> { + runnable = () -> + { + String versionId; + EDhApiUpdateBranch updateBranch = EDhApiUpdateBranch.convertAutoToStableOrNightly(Config.Client.Advanced.AutoUpdater.updateBranch.get()); + if (updateBranch == EDhApiUpdateBranch.STABLE) + { + versionId = ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()); + } + else + { + versionId = GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha"); + } + Minecraft.getInstance().setScreen(new UpdateModScreen( // TODO: Change to runnable, instead of tittle screen new TitleScreen(false), // We don't want to use the vanilla title screen as it would fade the buttons - (Config.Client.Advanced.AutoUpdater.updateBranch.get() == EDhApiUpdateBranch.STABLE ? ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()) : GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha")) + versionId )); }; } diff --git a/gradle.properties b/gradle.properties index 1428d48b1..01ed2b1c3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,8 +5,8 @@ org.gradle.caching=true # Mod Info mod_name=DistantHorizons -mod_version=2.0.4-a-dev -api_version=2.0.0 +mod_version=2.1.1-a-dev +api_version=2.1.0 maven_group=com.seibel.distanthorizons mod_readable_name=Distant Horizons mod_description=This mod generates and renders simplified terrain beyond the normal view distance at a low performance cost. Allowing you to see much farther without turning your game into a slideshow. @@ -18,7 +18,7 @@ mod_issues=https://gitlab.com/jeseibel/distant-horizons/-/issues mod_discord=https://discord.gg/xAB8G4cENx # Global Plugin Versions -manifold_version=2023.1.17 +manifold_version=2024.1.15 # 2023.1.17 can be used if there are mystery Java compiler issues nightconfig_version=3.6.6 lz4_version=1.8.0 diff --git a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinMinecraft.java b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinMinecraft.java index 45e166c78..a202069a0 100644 --- a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinMinecraft.java +++ b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinMinecraft.java @@ -8,6 +8,7 @@ import com.seibel.distanthorizons.core.jar.installer.GitlabGetter; import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter; import com.seibel.distanthorizons.core.jar.updater.SelfUpdater; import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants; +import com.seibel.distanthorizons.coreapi.ModInfo; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.TitleScreen; import org.spongepowered.asm.mixin.Mixin; @@ -75,11 +76,23 @@ public class MixinMinecraft && SelfUpdater.onStart() ) { - runnable = () -> { + runnable = () -> + { + String versionId; + EDhApiUpdateBranch updateBranch = EDhApiUpdateBranch.convertAutoToStableOrNightly(Config.Client.Advanced.AutoUpdater.updateBranch.get()); + if (updateBranch == EDhApiUpdateBranch.STABLE) + { + versionId = ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()); + } + else + { + versionId = GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha"); + } + Minecraft.getInstance().setScreen(new UpdateModScreen( // TODO: Change to runnable, instead of tittle screen new TitleScreen(false), // We don't want to use the vanilla title screen as it would fade the buttons - (Config.Client.Advanced.AutoUpdater.updateBranch.get() == EDhApiUpdateBranch.STABLE ? ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()) : GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha")) + versionId )); }; }