Skip to content

Commit 613957f

Browse files
committed
hyperlib updates
1 parent e48be6b commit 613957f

File tree

2 files changed

+10
-28
lines changed

2 files changed

+10
-28
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<dependency>
112112
<groupId>com.github.hyperdefined</groupId>
113113
<artifactId>hyperlib</artifactId>
114-
<version>1.0.2</version>
114+
<version>1.0.8</version>
115115
<scope>compile</scope>
116116
</dependency>
117117
</dependencies>

src/main/java/lol/hyper/toolstats/ToolStats.java

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
package lol.hyper.toolstats;
1919

2020
import lol.hyper.hyperlib.HyperLib;
21-
import lol.hyper.hyperlib.bstats.bStats;
22-
import lol.hyper.hyperlib.releases.hangar.HangarRelease;
23-
import lol.hyper.hyperlib.releases.modrinth.ModrinthPlugin;
24-
import lol.hyper.hyperlib.releases.modrinth.ModrinthRelease;
21+
import lol.hyper.hyperlib.bstats.HyperStats;
22+
import lol.hyper.hyperlib.releases.HyperUpdater;
2523
import lol.hyper.hyperlib.utils.TextUtils;
2624
import lol.hyper.toolstats.commands.CommandToolStats;
2725
import lol.hyper.toolstats.events.*;
@@ -161,8 +159,8 @@ public void onEnable() {
161159
hyperLib = new HyperLib(this);
162160
hyperLib.setup();
163161

164-
bStats bstats = new bStats(hyperLib, 14110);
165-
bstats.setup();
162+
HyperStats stats = new HyperStats(hyperLib, 14110);
163+
stats.setup();
166164

167165
textUtils = new TextUtils(hyperLib);
168166

@@ -236,27 +234,11 @@ public void onEnable() {
236234

237235
this.getCommand("toolstats").setExecutor(commandToolStats);
238236

239-
Bukkit.getAsyncScheduler().runNow(this, scheduledTask -> {
240-
ModrinthPlugin modrinthPlugin = new ModrinthPlugin("oBZj9E15");
241-
modrinthPlugin.get();
242-
243-
ModrinthRelease release = modrinthPlugin.getReleaseByVersion(this.getPluginMeta().getVersion());
244-
if (release == null) {
245-
logger.warning("You are running a version not published.");
246-
} else {
247-
int buildsBehind = modrinthPlugin.buildsVersionsBehind(release);
248-
if (buildsBehind > 0) {
249-
ModrinthRelease latest = modrinthPlugin.getLatestRelease();
250-
if (latest != null) {
251-
logger.info("You are " + buildsBehind + " versions behind. Please update!");
252-
logger.info("The latest version is " + latest.getVersion());
253-
logger.info(latest.getVersionPage());
254-
}
255-
} else {
256-
logger.info("Yay! You are running the latest version.");
257-
}
258-
}
259-
});
237+
HyperUpdater updater = new HyperUpdater(hyperLib);
238+
updater.setGitHub("hyperdefined", "ToolStats");
239+
updater.setModrinth("oBZj9E15");
240+
updater.setHangar("ToolStats", "paper");
241+
updater.check();
260242
}
261243

262244
public void loadConfig() {

0 commit comments

Comments
 (0)