-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from LostLuma/1.7
Upstream Sync for Minecraft 1.7
- Loading branch information
Showing
31 changed files
with
1,588 additions
and
555 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
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
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(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
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 |
---|---|---|
@@ -0,0 +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(); | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/terraformersmc/modmenu/api/UpdateInfo.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,29 @@ | ||
package com.terraformersmc.modmenu.api; | ||
|
||
import net.minecraft.text.Text; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public interface UpdateInfo { | ||
/** | ||
* @return If an update for the mod is available. | ||
*/ | ||
boolean isUpdateAvailable(); | ||
|
||
/** | ||
* @return The message that is getting displayed when an update is available or <code>null</code> to let ModMenu handle displaying the message. | ||
*/ | ||
@Nullable | ||
default Text getUpdateMessage() { | ||
return null; | ||
} | ||
|
||
/** | ||
* @return The URL to the mod download. | ||
*/ | ||
String getDownloadLink(); | ||
|
||
/** | ||
* @return The update channel this update is available for. | ||
*/ | ||
UpdateChannel getUpdateChannel(); | ||
} |
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
Oops, something went wrong.