-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to choose which update channel to receive notifications for (
#704) * Allow choosing an update channel to receive notifications for * Pass user preferred update channel to UpdateChecker * Change method of getting the preferred update channel * Request preferred version types from Modrinth only * Switch update channel and quick configure button order * Rerun update checks when clicking done in the modmenu options screen - No longer promotes updates to beta or alpha versions by default
- Loading branch information
Showing
10 changed files
with
82 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/com/terraformersmc/modmenu/api/UpdateChannel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.terraformersmc.modmenu.api; | ||
|
||
import com.terraformersmc.modmenu.config.ModMenuConfig; | ||
|
||
/** | ||
* Supported update channels, in ascending order by stability. | ||
*/ | ||
public enum UpdateChannel { | ||
ALPHA, | ||
BETA, | ||
RELEASE; | ||
|
||
/** | ||
* @return the user's preferred update channel. | ||
*/ | ||
public static UpdateChannel getUserPreference() { | ||
return ModMenuConfig.UPDATE_CHANNEL.getValue(); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
src/main/java/com/terraformersmc/modmenu/api/UpdateChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package com.terraformersmc.modmenu.api; | ||
|
||
public interface UpdateChecker { | ||
|
||
/** | ||
* Gets called when ModMenu is checking for updates. | ||
* This is done in a separate thread, so this call can/should be blocking. | ||
* | ||
* <p>Your update checker should aim to return an update on the same or a more stable channel than the user's preference which you can get via {@link UpdateChannel#getUserPreference()}.</p> | ||
* | ||
* @return The update info | ||
*/ | ||
UpdateInfo checkForUpdates(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters