diff --git a/build.gradle b/build.gradle index 78f0568..3b2dfb3 100644 --- a/build.gradle +++ b/build.gradle @@ -86,7 +86,7 @@ jar { manifest { attributes( - 'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ").format(new Date()) + 'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").format(new Date()) ) } } diff --git a/src/main/java/gg/projecteden/titan/update/TitanUpdater.java b/src/main/java/gg/projecteden/titan/update/TitanUpdater.java index 99f51c6..5a9bf77 100644 --- a/src/main/java/gg/projecteden/titan/update/TitanUpdater.java +++ b/src/main/java/gg/projecteden/titan/update/TitanUpdater.java @@ -34,19 +34,13 @@ public static void checkForUpdates() { Titan.log("Found " + modrinthVersions.size() + " possible version" + (modrinthVersions.size() == 1 ? "" : "s")); ModrinthVersion modrinthVersion = modrinthVersions.stream() - // Build Date will always be before the modrinth publish date. Check that the new version is at least 2 minutes older than current - .filter(version -> { - long diffInMillies = Math.abs(buildDate.getTime() - version.getDatePublished().getTime()); - long diff = TimeUnit.MINUTES.convert(diffInMillies, TimeUnit.MILLISECONDS); - return diff >= 2; - }) - .min(Comparator.comparing(ModrinthVersion::getDatePublished)) + .max(Comparator.comparing(ModrinthVersion::getDatePublished)) .orElse(null); if (modrinthVersion == null) return; - if (buildDate.after(modrinthVersion.getDatePublished())) + if (modrinthVersion.getVersion_number().equals(Titan.version())) return; Titan.log("Found Modrinth update!");