|
18 | 18 | package lol.hyper.toolstats;
|
19 | 19 |
|
20 | 20 | 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; |
25 | 23 | import lol.hyper.hyperlib.utils.TextUtils;
|
26 | 24 | import lol.hyper.toolstats.commands.CommandToolStats;
|
27 | 25 | import lol.hyper.toolstats.events.*;
|
@@ -161,8 +159,8 @@ public void onEnable() {
|
161 | 159 | hyperLib = new HyperLib(this);
|
162 | 160 | hyperLib.setup();
|
163 | 161 |
|
164 |
| - bStats bstats = new bStats(hyperLib, 14110); |
165 |
| - bstats.setup(); |
| 162 | + HyperStats stats = new HyperStats(hyperLib, 14110); |
| 163 | + stats.setup(); |
166 | 164 |
|
167 | 165 | textUtils = new TextUtils(hyperLib);
|
168 | 166 |
|
@@ -236,27 +234,11 @@ public void onEnable() {
|
236 | 234 |
|
237 | 235 | this.getCommand("toolstats").setExecutor(commandToolStats);
|
238 | 236 |
|
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(); |
260 | 242 | }
|
261 | 243 |
|
262 | 244 | public void loadConfig() {
|
|
0 commit comments