forked from TerraformersMC/ModMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix built-in update checker promoting older updates
This happens if the user is on a beta but only requests release update info.
- Loading branch information
Showing
3 changed files
with
197 additions
and
64 deletions.
There are no files selected for viewing
17 changes: 0 additions & 17 deletions
17
src/main/java/com/terraformersmc/modmenu/util/UpdateCheckerThread.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
src/main/java/com/terraformersmc/modmenu/util/UpdateCheckerThreadFactory.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,16 @@ | ||
package com.terraformersmc.modmenu.util; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.concurrent.ThreadFactory; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
public class UpdateCheckerThreadFactory implements ThreadFactory { | ||
static final AtomicInteger COUNT = new AtomicInteger(-1); | ||
|
||
@Override | ||
public Thread newThread(@NotNull Runnable r) { | ||
var index = COUNT.incrementAndGet(); | ||
return Thread.ofVirtual().name("ModMenu/Update Checker/%s".formatted(index)).unstarted(r); | ||
} | ||
} |
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