Skip to content

Commit

Permalink
Add update checker error for when I use it wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
ILikePlayingGames committed Jan 23, 2022
1 parent c1a7d14 commit c902602
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/main/java/codes/biscuit/skyblockaddons/misc/Updater.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import codes.biscuit.skyblockaddons.SkyblockAddons;
import codes.biscuit.skyblockaddons.core.Translations;
import codes.biscuit.skyblockaddons.core.UpdateInfo;
import codes.biscuit.skyblockaddons.tweaker.SkyblockAddonsTransformer;
import lombok.Getter;
import net.minecraft.event.ClickEvent;
import net.minecraft.event.HoverEvent;
Expand Down Expand Up @@ -174,7 +175,7 @@ public void checkForUpdate() {
Matcher currentMatcher = VERSION_PATTERN.matcher(currentVersion);
Matcher targetMatcher = VERSION_PATTERN.matcher(targetVersion);

// Its a patch if the major & minor numbers are the same & the player isn't upgrading from a beta.
// It's a patch if the major & minor numbers are the same & the player isn't upgrading from a beta.
isPatch = currentMatcher.matches() && targetMatcher.matches() &&
currentMatcher.group("major").equals(targetMatcher.group("major")) &&
currentMatcher.group("minor").equals(targetMatcher.group("minor")) &&
Expand All @@ -192,8 +193,17 @@ public void checkForUpdate() {
messageToRender = Translations.getMessage("messages.updateChecker.notificationBox.majorAvailable", targetVersion);
}
} else if (status == AHEAD) {
LOGGER.warn("The current version is newer than the latest version. Please tell an SBA developer to update" +
" the online data.");
if (!SkyblockAddonsTransformer.isDeobfuscated()) {
LOGGER.warn("The current version is newer than the latest version. Please tell an SBA developer to update" +
" the online data.");
} else {
LOGGER.error("The current version is newer than the latest version. You're doing something wrong.");
LOGGER.error("Current: " + current);
LOGGER.error("Latest: " + latestRelease);
LOGGER.error("Latest Beta: " + latestBeta);
LOGGER.error("Release Diff: " + releaseDiff);
LOGGER.error("Beta Diff: " + betaDiff);
}
} else {
LOGGER.info("Up to date!");
}
Expand Down

0 comments on commit c902602

Please sign in to comment.