aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2023-08-05 23:11:39 +1000
committerGitHub <noreply@github.com>2023-08-05 15:11:39 +0200
commit0ee93d0237f29f7ee296fd694c260dba58a92a67 (patch)
treeaa430453e850a866538d4f024bc4ea6d4e63be3a /src
parent2a78a5da01b361968770a54e4712a19c18c7feef (diff)
downloadNotEnoughUpdates-0ee93d0237f29f7ee296fd694c260dba58a92a67.tar.gz
NotEnoughUpdates-0ee93d0237f29f7ee296fd694c260dba58a92a67.tar.bz2
NotEnoughUpdates-0ee93d0237f29f7ee296fd694c260dba58a92a67.zip
Some changes to the backup repo (#796)
* maybe fix the backup repo not working sometimes * change wording
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java4
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/NEUStatsCommand.kt3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
index c60e7317..9d81c6ed 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
@@ -151,6 +151,7 @@ public class NEUManager {
public CraftingOverlay craftingOverlay;
private static boolean repoDownloadFailed = false;
+ public boolean onBackupRepo = false;
public NEUManager(NotEnoughUpdates neu, File configLocation) {
this.neu = neu;
@@ -278,6 +279,7 @@ public class NEUManager {
*/
public void switchToBackupRepo() {
Path destination = new File(repoLocation, "neu-items-master.zip").toPath();
+ onBackupRepo = true;
try (
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(
@@ -1584,6 +1586,8 @@ public class NEUManager {
})
.exceptionally(ex -> {
ex.printStackTrace();
+ System.out.println("switching over to the backup repo");
+ switchToBackupRepo();
return Arrays.asList(
"§cRepository not fully reloaded.",
"§cThere was an error reloading your repository.",
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/NEUStatsCommand.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/NEUStatsCommand.kt
index d5a39cb8..771da58c 100644
--- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/NEUStatsCommand.kt
+++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/NEUStatsCommand.kt
@@ -53,7 +53,7 @@ import javax.management.ObjectName
class NEUStatsCommand {
@SubscribeEvent
fun onCommands(event: RegisterBrigadierCommandEvent) {
- event.command("stats", "neustats") {
+ event.command( "neustats") {
thenLiteralExecute("modlist") {
clipboardAndSendMessage(
DiscordMarkdownBuilder()
@@ -198,6 +198,7 @@ class NEUStatsCommand {
builder.append("Last Commit", NotEnoughUpdates.INSTANCE.manager.latestRepoCommit)
builder.append("Repo Location", "https://github.com/${apiData.repoUser}/${apiData.repoName}/tree/${apiData.repoBranch}")
}
+ builder.append("Using Backup", NotEnoughUpdates.INSTANCE.manager.onBackupRepo)
builder.append("Loaded Items", NotEnoughUpdates.INSTANCE.manager.itemInformation.size.toString())
if (apiData.moulberryCodesApi.isEmpty()) {
apiData.moulberryCodesApi = "moulberry.codes"