From 5cd3760fd3cb9e992201595e572ddaf4a666b52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ales=CC=8C=20Fabia=CC=81nek?= Date: Sun, 28 Aug 2022 16:51:24 +0200 Subject: [PATCH] Simplified code --- .../com/faboslav/friendsandfoes/util/UpdateChecker.java | 6 ++---- .../friendsandfoes/platform/fabric/ModVersionImpl.java | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/com/faboslav/friendsandfoes/util/UpdateChecker.java b/common/src/main/java/com/faboslav/friendsandfoes/util/UpdateChecker.java index e81462259..87669f545 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/util/UpdateChecker.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/util/UpdateChecker.java @@ -29,7 +29,7 @@ public static void checkForNewUpdates() { String modVersion = ModVersion.getModVersion(); - if(modVersion == null) { + if (modVersion == null) { return; } @@ -71,9 +71,7 @@ public static String getLatestVersion() { return null; } - String latestModVersion = json.get(gameVersion).getAsString(); - - return latestModVersion; + return json.get(gameVersion).getAsString(); } } diff --git a/quilt/src/main/java/com/faboslav/friendsandfoes/platform/fabric/ModVersionImpl.java b/quilt/src/main/java/com/faboslav/friendsandfoes/platform/fabric/ModVersionImpl.java index 050865bf6..3e26457b7 100644 --- a/quilt/src/main/java/com/faboslav/friendsandfoes/platform/fabric/ModVersionImpl.java +++ b/quilt/src/main/java/com/faboslav/friendsandfoes/platform/fabric/ModVersionImpl.java @@ -5,7 +5,8 @@ import javax.annotation.Nullable; -public final class ModVersionImpl { +public final class ModVersionImpl +{ @Nullable public static String getModVersion() { return FabricLoader.getInstance().getModContainer(FriendsAndFoes.MOD_ID).map(modContainer -> modContainer.getMetadata().getVersion().toString()).orElse(null);