Skip to content

Commit

Permalink
Show the new version in the message
Browse files Browse the repository at this point in the history
  • Loading branch information
Edivad99 committed Sep 1, 2023
1 parent 2665542 commit a04d1c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ neo_version=47.1.63
mappings_channel=parchment
mappings_version=2023.08.06-1.20.1

mod_version=1.0.4
mod_version=1.0.5

# Deps
mixin_version=0.8.5
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/mods/railcraft/client/ClientManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,14 @@ static void handleClientLoggedOut(ClientPlayerNetworkEvent.LoggingOut event) {
@SubscribeEvent
static void handleClientLoggedIn(ClientPlayerNetworkEvent.LoggingIn event) {
var modInfo = ModList.get().getModFileById(Railcraft.ID).getMods().get(0);
var versionStatus = VersionChecker.getResult(modInfo).status();
var result = VersionChecker.getResult(modInfo);
var versionStatus = result.status();

if (versionStatus.shouldDraw()) {
var newVersion = result.target().toString();
var message = Component.literal("Railcraft Reborn: ").withStyle(ChatFormatting.GREEN)
.append(Component.literal("A new version is available to download.")
.append(Component.literal(
"A new version (%s) is available to download.".formatted(newVersion))
.withStyle(style -> style
.withColor(ChatFormatting.WHITE)
.withUnderlined(true)
Expand Down

0 comments on commit a04d1c7

Please sign in to comment.